Initializing logger earlier.

Error messages related to port parsing and socket opening will now be
printed too.