From 5824b3e9d8e81fe38b15676f076255b93785f05a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 10 Oct 2020 14:38:54 +0100 Subject: [PATCH] Logger TimeStamp attribute uses UTC --- Logger.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Logger.cpp b/Logger.cpp index 4c1a92874..3f7443990 100644 --- a/Logger.cpp +++ b/Logger.cpp @@ -8,8 +8,11 @@ #include #include #include +#include +#include +#include +#include #include -#include #include #include #include @@ -98,10 +101,14 @@ namespace Logger public: CommonInitialization () { - // Add common attributes: LineID, TimeStamp, ProcessID, ThreadID - logging::add_common_attributes (); - // Add boost log timer as global attribute Uptime - logging::core::get ()->add_global_attribute ("Uptime", attrs::timer ()); + // Add attributes: LineID, TimeStamp, ProcessID, ThreadID, and Uptime + auto core = logging::core::get (); + core->add_global_attribute ("LineID", attrs::counter (1)); + core->add_global_attribute("TimeStamp", attrs::utc_clock ()); + core->add_global_attribute("ProcessID", attrs::current_process_id ()); + core->add_global_attribute("ThreadID", attrs::current_thread_id ()); + core->add_global_attribute ("Uptime", attrs::timer ()); + // Allows %Severity% to be used in ini config file for property Filter. logging::register_simple_filter_factory ("Severity"); // Allows %Severity% to be used in ini config file for property Format.