From 67fb24cc1106e19b8b02611d9cf83ffcf0eae008 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Thu, 14 Jul 2022 14:07:56 +0200 Subject: [PATCH] Windows: only include critical messages in early log messages The point of logging to the Windows Event Log was to catch errors that happen before the full logging configuration has been loaded and enabled. Messages like the number of loaded objects per type just cause noise in the log and provide little benefit. Therefore raise the required log level at this stage. Note that this commit removes the (never documented) ability to use the -x flag to change the level. But doing so would require patching the command line of the service in the registry anyways. --- lib/base/logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base/logger.cpp b/lib/base/logger.cpp index fe5668779..531839ca3 100644 --- a/lib/base/logger.cpp +++ b/lib/base/logger.cpp @@ -256,7 +256,7 @@ Log::~Log() } #ifdef _WIN32 - if (Logger::IsEarlyLoggingEnabled() && entry.Severity >= Logger::GetConsoleLogSeverity()) { + if (Logger::IsEarlyLoggingEnabled() && entry.Severity >= LogCritical) { WindowsEventLogLogger::WriteToWindowsEventLog(entry); } #endif /* _WIN32 */