Implemented logging.