Adding diagnostics logging.