Early review of std.logger
ilya-stromberg
ilya-stromberg-2009 at yandex.ru
Sun Oct 20 09:05:45 PDT 2013
On Sunday, 20 October 2013 at 15:34:50 UTC, Sean Kelly wrote:
> 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.
+1
* delete old files when:
- you have more than N files
- size of all log files more than ... Mb
* support compress rotated files (for examle, in zip or gzip
format)
More information about the Digitalmars-d
mailing list