Added self-logging.