From 84aefc33627af4ef1dac780a43d6fa2b82ea086f Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 8 Jan 2023 18:23:07 +0200 Subject: [PATCH] Changed log file format: print timestamp instead of thread ID --- config/schemas/settings.json | 2 +- lib/logging/CLogger.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/schemas/settings.json b/config/schemas/settings.json index 9baa638c6..f2df37927 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -356,7 +356,7 @@ "properties" : { "format" : { "type" : "string", - "default" : "%l %n [%t] - %m" + "default" : "[%c] %l %n - %m" } } }, diff --git a/lib/logging/CLogger.cpp b/lib/logging/CLogger.cpp index 564e6a6de..dfec2d018 100644 --- a/lib/logging/CLogger.cpp +++ b/lib/logging/CLogger.cpp @@ -295,6 +295,7 @@ std::string CLogFormatter::format(const LogRecord & record) const boost::algorithm::replace_first(message, "%n", record.domain.getName()); boost::algorithm::replace_first(message, "%t", record.threadId); boost::algorithm::replace_first(message, "%m", record.message); + boost::algorithm::replace_first(message, "%c", boost::posix_time::to_simple_string(record.timeStamp)); //return boost::to_string (boost::format("%d %d %d[%d] - %d") % dateStream.str() % level % record.domain.getName() % record.threadId % record.message);