Reworked logging.