Page 1 of 1

Add compression and archive options to log settings

Posted: August 31st, 2008, 5:49 pm
by onebinary
- Add compression options (gzip and bzip2)
- Add additional rotation options (by time)

Might be useful to adopt the more traditional [linux] log methodology of 'archive and compress' when rotating logs.  It would be cool to see both gzip and bzip2 as compression options.

This is of course much easier on Linux since most standard installations usually install gzip and bzip2 by default.  Not sure how that works on Windows.  OS X might also include gzip and/or bzip2 by default, but not sure there either.

One thing that this might affect is the log rotation scheme.  Looks like the current scheme is by size, which I think should be OK as long as it's looking at pre-compression sizes.  It might also be useful to allow users to rotate by time as well, such as rotate every day/x days/week/etc.

Re: Add compression and archive options to log settings

Posted: September 2nd, 2008, 6:33 am
by shypike
The only reason logging is implemented is for users to submit evidence of problems.
Most users don't care about it (should they know).

A "full" log is 5x5MB = 25 MB, which is sufficient for most cases.
What's the problem?

Re: Add compression and archive options to log settings

Posted: October 26th, 2008, 2:55 am
by onebinary
(Just saw the notification of this reply... yeah I'm a bit backlogged on email :D )

I dunno, I guess to make the product more robust? :)  In my particular case I use the software a lot, and I do release testing, so debug mode is always enabled.  I also like to hunt down issues that I come across/run into.  The debug logging gets quite chatty, and 5MB goes pretty quick.  I would prefer to allow larger/longer log files to build, with the option to compress on rotate (which makes disk usage negligible).  I guess the ubergeek in me just likes to see more options to allow more control, but as you mentioned, this really isn't that critical in the grand scheme of things.

Code: Select all

onebinary@home:/data/sabnzbd/logs$ ls -ltr sabnzbd.*
-rw-r--r-- 1 onebinary onebinary       0 2008-07-03 19:09 sabnzbd.error.log
-rw------- 1 onebinary onebinary 5242733 2008-10-23 00:09 sabnzbd.log.5
-rw------- 1 onebinary onebinary 5242721 2008-10-23 04:17 sabnzbd.log.4
-rw------- 1 onebinary onebinary 5242835 2008-10-23 23:39 sabnzbd.log.3
-rw------- 1 onebinary onebinary 5242828 2008-10-24 05:04 sabnzbd.log.2
-rw------- 1 onebinary onebinary 5242775 2008-10-25 13:07 sabnzbd.log.1
-rw------- 1 onebinary onebinary  640429 2008-10-26 00:15 sabnzbd.log

Re: Add compression and archive options to log settings

Posted: October 26th, 2008, 3:26 am
by shypike
You can change the settings directly in the INI file.

Code: Select all

[logging]
    ## max size of SABnzbd.log (in bytes)
    max_log_size = 5242880
    ## how many backups of SABnzbd.log to keep around
    log_backups = 5
Compression of a completed log file may be cool to do, I'll keep it in mind.