Page 1 of 1

Debug Log stops logging

Posted: April 3rd, 2015, 4:12 pm
by ALbino
Hey guys,

I've been trying to debug a few things with SABnzbd for a while, but I get frustrated because my log file stops being updated fairly quickly. Right now my entire log is only a 3 hour period from March 27th, which is literally a week ago, and there hasn't been any updates since then. The few times I've had crashes and went to look in the log, it had stopped logging ages before the crash, and then when I start the program back up it wipes the old log and starts a fresh one, so whatever was there is now gone. If I close the program and re-open it I get a fresh empty log (just did it now in fact) but it's going to stop logging in a few hours, which defeats the purpose.

Right now I have my logging set to +Debug. Is there some other setting I'm missing that is limiting the number of lines or filesize?

Windows 7/SAB 0.7.20

Thanks.

Re: Debug Log stops logging

Posted: April 3rd, 2015, 4:33 pm
by shypike
Unfortunately you're hitting a well-known bug in Python in Windows.
It's been known for years, but the authors refuse to solve it.
It requires an extremely convoluted work-around, which we haven't taken the time for yet.
Restarting SABnzbd resolves the problem.

Re: Debug Log stops logging

Posted: April 3rd, 2015, 4:41 pm
by ALbino
Good to know, it was driving me crazy.

Do you happen to know what the theoretical limit is? That way if I'm debugging I know when my last chances are to look at the log.

Re: Debug Log stops logging

Posted: April 4th, 2015, 11:34 am
by shypike
Logging can be disrupted each time an external program is started.
So when par2 or unrar run.
But it doesn't go wrong most of the time.
It's some weird race-condition having to do with redirection of console input and output of the external program.

Re: Debug Log stops logging

Posted: April 4th, 2015, 1:11 pm
by ALbino
That's terrible, and I can see how frustrating that could be.

Maybe for 0.8.0 when you're set to Debug mode you could try and detect when it stops logging, make the current log an archived log of sorts, and then manually start a fresh one? Obviously that's not necessary most of the time, but if you're specifically in Debug mode then clearly you're looking to have all of the logs.