Rotate log on the 1st of the month

This commit is contained in:
Bill Somerville 2020-10-03 00:54:05 +01:00
parent a4e636cd52
commit 80feb93e6f
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -130,13 +130,13 @@ WSJTXLogging::WSJTXLogging ()
auto sys_sink = boost::make_shared<sinks::asynchronous_sink<sinks::text_file_backend>> auto sys_sink = boost::make_shared<sinks::asynchronous_sink<sinks::text_file_backend>>
( (
keywords::auto_flush = false keywords::auto_flush = false
, keywords::file_name = app_data.absoluteFilePath ("wsjtx_syslog_%Y-%m.log").toStdString () #if BOOST_VERSION / 100 >= 1070
#if BOOST_VERSION / 100000 >= 1 && (BOOST_VERSION / 100) % 1000 >= 70 , keywords::file_name = app_data.absoluteFilePath ("wsjtx_syslog.log").toStdString ()
, keywords::target_file_name = app_data.absoluteFilePath ("old_logs/wsjtx_syslog_%Y-%m-%d_%H-%M-%S.%N.log").toStdString () , keywords::target_file_name = app_data.absoluteFilePath ("logs/wsjtx_syslog_%Y-%m.log").toStdString ()
, keywords::rotation_size = 5 * 1024 * 1024
#else #else
, keywords::time_based_rotation = sinks::file::rotation_at_time_point (gregorian::greg_day (1), 0, 0, 0) , keywords::file_name = app_data.absoluteFilePath ("logs/wsjtx_syslog_%Y-%m.log").toStdString ()
#endif #endif
, keywords::time_based_rotation = sinks::file::rotation_at_time_point (gregorian::greg_day (1), 0, 0, 0)
, keywords::open_mode = std::ios_base::out | std::ios_base::app , keywords::open_mode = std::ios_base::out | std::ios_base::app
, keywords::enable_final_rotation = false , keywords::enable_final_rotation = false
); );
@ -148,8 +148,8 @@ WSJTXLogging::WSJTXLogging ()
keywords::max_size = 40 * 1024 * 1024 keywords::max_size = 40 * 1024 * 1024
, keywords::min_free_space = 1024 * 1024 * 1024 , keywords::min_free_space = 1024 * 1024 * 1024
, keywords::max_files = 12 , keywords::max_files = 12
#if BOOST_VERSION / 100000 >= 1 && (BOOST_VERSION / 100) % 1000 >= 70 #if BOOST_VERSION / 100 >= 1070
, keywords::target = app_data.absoluteFilePath ("old_logs").toStdString () , keywords::target = app_data.absoluteFilePath ("logs").toStdString ()
#endif #endif
) )
); );