Implementation of logging.