Boost logo

Boost Users :

From: Isabelle Poueriet (isabelleccny_at_[hidden])
Date: 2021-05-20 21:50:51


My application is not cleaning up properly - it leaves the process behind in task manager after exiting.I read about this below, but I'm setting all sinks from a configuration file.
Can the shutdown documented in link below be done from the config file? If so, what are the options? I am using multi-threaded loggers.
Thanks in advance.
c++ - How to stop all asynchronous sinks when using Boost.Log - Stack Overflow

Snippet of code referenced in link above:

               // Remove the sink from the core, so that no records are passed to it              core->remove_sink(sink);
      // Break the feeding loop
      sink->stop();

      // Flush all log records that may have left buffered
      sink->flush();

      sink.reset();

Snippet of my config file:
# Logging core settings section. May be omitted if no parameters specified within it.[Core]# <DisableLogging> true=disable all logging; false=enable all logging Q. do we care to disable specific channels?DisableLogging=false
# Sink settings sections#GTSMAIN logs everything to a text file[Sinks.GTSMAIN]Destination="TextFile"
#<Asynchronous> if true, a thread is dedicated to writing to log, otherwise blocks main thread to write.Asynchronous="true"
# Enables automatic stream flush after each log record.AutoFlush="true"
# Formatter string. Optional, by default only log record message text is written.Format="[%TimeStamp%][%ThreadID%][%Severity%][%Channel%] %Message%"
#Target specifies where to save files when rotation occurrsTarget="C:/Temp/GtsLogs"FileName="gtsMainLog_%3N.log"#RotationSize in bytesRotationSize="1048576"#MaxSize - oldest file in the target directory will be deleted when Maxsize(in bytes) is reachedMaxSize=100485760OpenMode="append"#Apply no filter for the main log# Sink-specific filter. Optional, by default no filter is applied.#============================================================================================================[Sinks.ADM]Destination="TextFile"##<Asynchronous> if true, a thread is dedicated to writing to log, otherwise blocks main thread to write.Asynchronous="true"### Enables automatic stream flush after each log record.AutoFlush="true"### Formatter string. Optional, by default only log record message text is written.Format="[%TimeStamp%][%ThreadID%][%Severity%][%Channel%] %Message%"#Target="C:/Temp/GtsLogs"FileName="gtsAdm_%3N.log"##RotationSize in bytesRotationSize="1048576"##MaxSize - oldest file in the target directory will be deleted when Maxsize(in bytes) is reachedMaxSize=100485760##Apply no filter for the main log## Sink-specific filter - anything in AGR channel. Optional, by default no filter is applied.Filter="%Channel% matches \"ADM\""##============================================================================================================[Sinks.AGR]Destination="TextFile"###<Asynchronous> if true, a thread is dedicated to writing to log, otherwise blocks main thread to write.Asynchronous="true"### Enables automatic stream flush after each log record.AutoFlush="true"### Formatter string. Optional, by default only log record message text is written.Format="[%TimeStamp%][%ThreadID%][%Severity%][%Channel%] %Message%"#Target="C:/Temp/GtsLogs"FileName="gtsAgr_%3N.log"##RotationSize in bytesRotationSize="1048576"##MaxSize - oldest file in the target directory will be deleted when Maxsize(in bytes) is reachedMaxSize=100485760## Sink-specific filter - anything in AGR channel. Optional, by default no filter is applied.Filter="%Channel% matches \"AGR\""



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net