Prepare logging.