Different implementation for console and file logging.