The soldier kept watch in all directions in the darkness.

Literal

Soldier [topic-は] darkness [in-で] four-directions [to-に] eyes [object-を] distributed.

四方に目を配る means 'to look in all directions / keep a watchful eye all around' — 四方 (four directions) + に + 目を配る (to distribute one's gaze). 暗闇で sets the scene in darkness. A vivid military or suspense scene that teaches both the idiom and atmospheric description.