put logfile setting up prior to other error output