loglevel must be set before trying to write a log