TOKYO - Japan logged its second largest ever monthly goods trade deficit of 2.38 trillion yen ($17.7 billion) in May, remaining in the red for the 10th consecutive month mainly due to high commodity prices, the Finance Ministry said Thursday.