[Boost-bugs] [Boost C++ Libraries] #11719: Create a log file only if some data is written to it

Subject: [Boost-bugs] [Boost C++ Libraries] #11719: Create a log file only if some data is written to it
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-12 10:52:09


#11719: Create a log file only if some data is written to it
--------------------------------+-------------------------
 Reporter: parikshit.nangre@… | Owner: andysem
     Type: Support Requests | Status: new
Milestone: To Be Determined | Component: log
  Version: Boost 1.59.0 | Severity: Showstopper
 Keywords: |
--------------------------------+-------------------------
 I am creating a log file using

 src::severity_logger< severity_level > m_DbLogger;
 logging::add_file_log
 (

    keywords::auto_flush = true,
    keywords::file_name = m_Settings.LogFileSQL + "_diagnostics.log",
    keywords::time_based_rotation = sinks::file::rotation_at_time_point(0,
 0, 0),
    keywords::format =
    (
       boost::log::expressions::stream
       << boost::log::expressions::format_date_time<
 boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S")
       << ": [" << boost::log::expressions::attr< severity_level
>("Severity")
       << "] " << boost::log::expressions::smessage
     )
 );

 It creates a log file before any log goes into it. I want to have that log
 file ONLY IF some data is written into it. If no log goes into it we dont
 want to see that log file.

 Please suggest a solution for it.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11719>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC