Expand and improve logging.