Move up intialisation of logging, so we catch errors in handling 'preload modules'