Clean the logging code and check options before starting the server.