Page 1 of 1

Stop Logs From Being Truncated

Posted: December 31st, 2014, 9:44 pm
by brando56894
I have a lot of RAM in my system (16 GB dual channel DDR3 in my NAS and 20 GB triple channel DDR3 in my desktop) and I was wondering if there was a way to stop SAB from creating mutliple log files and just create one huge log file? For example, I'm setting up SAB on my new FreeNAS build and it will randomly give me errors about SQL or other things and they'll be 20 errors in about 10,000 messages and I'll have to look through ten different log files just to find the one error that I'm looking for. It'd be much easier to just open one log, even if it had 100,000 lines and just do a quick search for a string.

Going along with this, is there a way to stop it from spitting out errors whenever it can't grab an article from the server? I had about 300 things in my queue and each article wasn't found for some reason so there were thousands of "can't find article" errors in my logs and buried in between those were the errors that I actually cared about. Is there any way I can remove those, short of grepping them out?

Re: Stop Logs From Being Truncated

Posted: January 1st, 2015, 3:21 am
by sander
brando56894 wrote: Going along with this, is there a way to stop it from spitting out errors whenever it can't grab an article from the server? I had about 300 things in my queue and each article wasn't found for some reason so there were thousands of "can't find article" errors in my logs and buried in between those were the errors that I actually cared about. Is there any way I can remove those, short of grepping them out?
Do you mean lines like this:

Code: Select all

2014-09-15 18:33:19,114::INFO::[downloader:602] Thread [email protected]:563: Article [email protected] missing (error=430)
If so, the corresponding code is in sabnzbd/downloader.py, line 602 (as the log line itself says):

Code: Select all

                        logging.info('Thread %s@%s:%s: Article ' + \
                                        '%s missing (error=%s)',
                                        nw.thrdnum, nw.server.host,
                                        nw.server.port, article.article, code)
So you can remove these code lines. Or change "logging.info" into "logging.debug" (assuming you have log level set to Info).

HTH

Re: Stop Logs From Being Truncated

Posted: January 1st, 2015, 1:16 pm
by brando56894
Yep that's it! Thanks!

Any way to get the logs into one big file though?

Re: Stop Logs From Being Truncated

Posted: January 1st, 2015, 1:26 pm
by sander
brando56894 wrote:Yep that's it! Thanks!

Any way to get the logs into one big file though?

A hint ... :

Code: Select all

sander@flappie:~$ grep -i max_log_size ~/.sabnzbd/sabnzbd.ini
max_log_size = 5242880

sander@flappie:~$ ll ~/.sabnzbd/logs/sabnzbd.log*
-rw------- 1 sander sander 2048335 jan  1 15:23 /home/sander/.sabnzbd/logs/sabnzbd.log
-rw------- 1 sander sander 5242822 dec 29 18:19 /home/sander/.sabnzbd/logs/sabnzbd.log.1
-rw------- 1 sander sander 5242806 dec 28 19:25 /home/sander/.sabnzbd/logs/sabnzbd.log.2
-rw------- 1 sander sander 5242732 dec 27 20:50 /home/sander/.sabnzbd/logs/sabnzbd.log.3
-rw-rw-r-- 1 sander sander 5242823 dec 27 17:33 /home/sander/.sabnzbd/logs/sabnzbd.log.4
-rw------- 1 sander sander 5242861 dec 25 11:48 /home/sander/.sabnzbd/logs/sabnzbd.log.5
sander@flappie:~$
So ... do you see the correlation? If so: you should know what to try

Re: Stop Logs From Being Truncated

Posted: January 1st, 2015, 2:03 pm
by brando56894
Thanks buddy :-) I've used SAB for years and never noticed that setting in the config file.

Re: Stop Logs From Being Truncated

Posted: January 1st, 2015, 2:21 pm
by sander
brando56894 wrote:Thanks buddy :-) I've used SAB for years and never noticed that setting in the config file.
Me neither! But I just used a few commands to find out (all from the directory containing SABnzbd.py and subdirectories):

Code: Select all

grep -ir "sabnzbd.log" *
grep -ir logsize  *
grep -ir log_size.get_int *
grep -i log ~/.sabnzbd/sabnzbd.ini
ll ~/.sabnzbd/logs/sabnzbd.*
HTH