Bug 10188 - Improved Scanner logging
: Improved Scanner logging
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 7.4.0
: PC Other
: -- normal (vote)
: 7.4.0
Assigned To: Brandon Black
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-01 12:13 UTC by Dan Evans
Modified: 2009-10-05 14:34 UTC (History)
6 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Evans 2008-12-01 12:13:20 UTC
Can we alter how we create Scanner logs such that: we dump the folder & filename of the file to be scanned into the logfile *before* we try reading the file?

This will allow us to have a record of which file potentially caused a Scanner crash.  Without this it involves a lot of guesswork and long email threads with Support to narrow down a problemed file.

If there's a better way to achieve this, please chime in.  I'm tackling this with only my understanding of our logging process to guide me.
Comment 1 John Keeling 2008-12-15 22:10:55 UTC
Refer to this thread - http://forums.slimdevices.com/showthread.php?t=56297 and Incident: 081208-000910.
 I have upgraded to SC 7.3 and still get scanner errors, but cannot get the log to show the path and filename despite setting Settings/Advanced/Logging/(Scan), (Scan.Import) and (Scan.Scanner) to Error then Warn then Info and finally Debug and running a 'Clear and rescan' each time.  WIN XP SP3, SC 7.3.
Comment 2 Jim McAtee 2008-12-16 01:20:17 UTC
Do you mean at the default logging levels?  That would be a lot of data at the WARN level.

I was thinking, though, that now that there's some quick-and-dirty log rotation to keep the logs from growing indefinitely, it might be advantageous to change the logging level for certain tasks.  Maybe some of the scanning levels could be changed to INFO.
Comment 3 James Richardson 2008-12-17 14:47:27 UTC
Dean: your thoughts?
Comment 4 Blackketter Dean 2008-12-17 14:53:39 UTC
Brandon is working on the new scanner as part of his new_schema work.

Brandon: what's your plan relative to logging?
Comment 5 Dan Evans 2008-12-17 14:57:05 UTC
I'd like to get some traction on this.  We frequently have open cases where some improved logs would help a lot with...

Example 1: Customer has 1.5 TB of music on a NAS device. He's running SC on a Mac and pointing to the mounted terabyte drive. His issue is that the Scanner never completes its scan. He states that it runs for days when it scans and doesn't stop unless he manually aborts the scan. 

Example 2: Other cases where the Scanner actually crashes on a file, we really need to know which file it's choking on.

Do you have any suggestions as to how our current logging model can help here? 
Or how we can improve our logging to address these cases?
Comment 6 Dan Evans 2008-12-17 14:57:59 UTC
Also, anything we can do on this before 8.0?
Comment 7 Michael Herger 2008-12-18 00:36:20 UTC
Dan - there's already a "Adding $url to database." message before the file is read (scan.scanner). 
Comment 8 Dan Evans 2008-12-18 09:36:56 UTC
Michael-- it may be there, but it does not provide the information we need on a crash.  Is it working correctly?  Or is it not being fed into the log early enough?
Comment 9 Jim McAtee 2008-12-18 11:17:17 UTC
(In reply to comment #7)
> Dan - there's already a "Adding $url to database." message before the file is
> read (scan.scanner). 

scanner.pm, line 338

$log->debug("Adding $url to database.");

It's at the DEBUG level?  This message would need to be at at least the default ERROR level to be useful.
Comment 10 Dan Evans 2008-12-18 11:37:45 UTC
For any logging we have these choices:

Off
Fatal
Error
Warn
Info
Debug

We always select Debug when generating logs.  I have presumed that Debug includes all-of-the-above.  Is this true?  Are we missing the error because we are selecting Debug?
Comment 11 Jim McAtee 2008-12-18 13:34:13 UTC
(In reply to comment #10)
> We always select Debug when generating logs.  I have presumed that Debug
> includes all-of-the-above.  Is this true?

I believe that's correct.

>  Are we missing the error because we are selecting Debug?

One critical point is the you _must_ check "Save logging settings for use at next application restart" for the settings to have any effect during the next scan.  This isn't explained on that page.  It could be seen as something of a bug that these settings aren't passed along to the scanner, because they may exist only in the memory of the running SqueezeCenter.  I always thought this checkbox should be checked by default.  If you _don't_ want the logging levels saved, you should have to clear the box before hitting 'Apply'.
Comment 12 Andy Grundman 2009-05-16 05:40:23 UTC
Fixed in 7.4, scanner log has the following changes:

Log is wiped before every scan.
Every file is logged before it is scanned.
The inability to scan a file is logged with "ERROR SCANNING".
Comment 13 James Richardson 2009-10-05 14:34:14 UTC
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server!
    * SqueezeCenter: 28672
    * Squeezebox 2 and 3: 130
    * Transporter: 80
    * Receiver: 65
    * Boom: 50
    * Controller: 7790
    * Radio: 7790  

Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes

If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.