On Wednesday, 16 October 2013 at 07:18:39 UTC, ilya-stromberg wrote:

Disagree. We need a log rotation support.
As I can see, available options could be:

* rotating conditions
 - by date (rotate every hour, day (default), week, month, year)
 - by file size (rotate if file size more than ... Mb)
- by count log lines (rotate if log contains more than ... log lines) - combination of previous conditions (for example, rotate every day or rotate if file size more than 100 Mb)

* file names after rotation
 - by numbers (my.log, my.log.0, my.log.1, ...)
 - by ISO date and time (my-2013-10-16-00-00-00.log)

* ability to use system log rotation utility

I really like that Boost::Log also provides an option to replace old log files (instead of creating new ones) when disk capacity reaches a certain threshold. It might also be worth providing an option to simply limit the max log file count to N, which then replaces oldest first. In some unexpected situations I've seen the disk fill from a badly behaved program, and these are a nice safeguard.

Reply via email to