move logfile setup right after config parsing