Fixes KeyNotFoundException in logging.