Difference between revisions of "Posting Logs"

From MythTV Official Wiki
Jump to: navigation, search
(Getting Useful Logs: Tell users to start with default-verbosity logs--reading 10M lines of garbage to find the blatantly-obvious-at-default-verbosity message is annoying)
m (Why bother?)
Line 49: Line 49:
 
provides events leading up to an error.
 
provides events leading up to an error.
 
Also, be it a terminal, email client or some pastebins, long lines from
 
Also, be it a terminal, email client or some pastebins, long lines from
logfiles frequently get folded. Which is easier to read, this:
+
logfiles frequently get folded. Which is easier to read, this?:
 
<pre>
 
<pre>
 
2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:
 
2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:
Line 74: Line 74:
 
...
 
...
 
</pre>
 
</pre>
or this:
+
or this?:
 
<pre>
 
<pre>
 
2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:2545 (ConfigureLogging) - mythbackend version: master [v0.27-pre2-278-g3eef99e-dirty] www.mythtv.org
 
2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:2545 (ConfigureLogging) - mythbackend version: master [v0.27-pre2-278-g3eef99e-dirty] www.mythtv.org

Revision as of 10:57, 23 February 2013

Frequently, when attempting to resolve a problem, users will be asked for logfiles. Using a pastebin and suppling the returned URL is a good way to provide that data when using a mailing list or on IRC.


Important.png Note: This method is not to be used when posting logfiles for trouble tickets in Trac. Use its Attach file button for logs and --version output.

Getting Useful Logs

To get useful logfiles, ensure that only relevant information is shown in the file, but without trimming any information from the logfile. The easiest way to do this is to shut down your MythTV system (or at minimum, the application for which you are attempting to create a logfile). At this point, you may decide to delete all existing logfiles, so that you can easily find which one(s) to post. Then, restart mythbackend, then mythfrontend, and perform those actions required to cause the failure you're investigating. At this point, exit mythbackend and mythfrontend, then post the logs.

Note, also, that generally when diagnosing issues, you should start at default verbosity, and only add additional -v options when requested (or, if diagnosing the issue yourself, after determining that the default verbosity logs do not show any information helpful in diagnosing the issue). If you instead start with a too-verbose log setting (such as -v all), important messages will get buried in the noise.

Quick start

pastebinit <logfileName>

The above puts the logfile in a pastebin and returns its URL, such as:

http://paste.ubuntu.com/1405788/

which can be cut and pasted to the #mythtv-users IRC channel or to a response on the mythtv-users mailing list.

It would be wise to check the size of a logfile before doing this. If the file has days/months of data in it, edit the file. Go to the end and search backwards for a string that looks similar to this.

mythbackend version: master [v0.27-pre2-278-g3eef99e]

and chop off everything above it.

Important.png Note: Be sure that lines with text similar to this are in the log: mythbackend version: master [v0.27-pre2-278-g3eef99e] www.mythtv.org and Enabled verbose msgs:

Where are the logfiles stored?

This depends on the distribution and or personal configurations. Typical locations are /var/log/syslog and files under /var/log/mythtv. If necessary, typing ps ax | grep mythProgramName | grep -v grep will display the options used by a running MythTV program. Most likely that will be mythbackend. See Logging for more detail.

If running a command manually, the logfile can be placed in /tmp. For example: mythshutdown --lock -v general --loglevel info --logpath /tmp.

Why bother?

Providing an entire logfile gives the person attempting to diagnose a problem the MythTV version information. It also provides events leading up to an error. Also, be it a terminal, email client or some pastebins, long lines from logfiles frequently get folded. Which is easier to read, this?:

2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:
2545 (ConfigureLogging) - mythbackend version: master [v0.27-pre2-278-g3eef99e-dirty]
www.mythtv.org
2012-12-02 08:56:09.859608 C [3008/3008] thread_unknown mythcommandlineparser.cpp:2547
 (ConfigureLogging) - Qt version: compile: 4.8.1, runtime: 4.8.1
2012-12-02 08:56:09.859613 N [3008/3008] thread_unknown mythcommandlineparser.cpp:2549
 (ConfigureLogging) - Enabled verbose msgs:  general
2012-12-02 08:56:09.859699 N [3008/3008] thread_unknown logging.cpp:852 (logStart) -
Setting Log Level to LOG_INFO
2012-12-02 08:56:09.860504 I [3008/3008] thread_unknown signalhandling.cpp:194
(SetHandlerPrivate) - Setup Interrupt handler
2012-12-02 08:56:09.860514 I [3008/3008] thread_unknown signalhandling.cpp:194
(SetHandlerPrivate) - Setup Terminated handler
2012-12-02 08:56:09.860522 I [3008/3008] thread_unknown signalhandling.cpp:194
 (SetHandlerPrivate) - Setup Segmentation fault handler
2012-12-02 08:56:09.860529 I [3008/3008] thread_unknown signalhandling.cpp:194
(SetHandlerPrivate) - Setup Aborted handler
2012-12-02 08:56:09.860536 I [3008/3008] thread_unknown signalhandling.cpp:194
(SetHandlerPrivate) - Setup Bus error handler
2012-12-02 08:56:09.860543 I [3008/3008] thread_unknown signalhandling.cpp:194
(SetHandlerPrivate) - Setup Floating point exception handler
...

or this?:

2012-12-02 08:56:09.859586 C [3008/3008] thread_unknown mythcommandlineparser.cpp:2545 (ConfigureLogging) - mythbackend version: master [v0.27-pre2-278-g3eef99e-dirty] www.mythtv.org
2012-12-02 08:56:09.859608 C [3008/3008] thread_unknown mythcommandlineparser.cpp:2547 (ConfigureLogging) - Qt version: compile: 4.8.1, runtime: 4.8.1
2012-12-02 08:56:09.859613 N [3008/3008] thread_unknown mythcommandlineparser.cpp:2549 (ConfigureLogging) - Enabled verbose msgs:  general
2012-12-02 08:56:09.859699 N [3008/3008] thread_unknown logging.cpp:852 (logStart) - Setting Log Level to LOG_INFO
2012-12-02 08:56:09.860504 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Interrupt handler
2012-12-02 08:56:09.860514 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Terminated handler
2012-12-02 08:56:09.860522 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Segmentation fault handler
2012-12-02 08:56:09.860529 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Aborted handler
2012-12-02 08:56:09.860536 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Bus error handler
2012-12-02 08:56:09.860543 I [3008/3008] thread_unknown signalhandling.cpp:194 (SetHandlerPrivate) - Setup Floating point exception handler
...

What if pastbinit isn't on a system?

If the program doesn't exist, it will be necessary to use the distributions package manager to get a copy. Readers are encouraged to update this Wiki with their distribution's method.

For *buntu:

sudo apt-get install pastebinit

A note on customization

By adding a file like this, users can save their pastebinit preferences:

Script.png ~/.pastebinit.xml

<pastebinit>
    <pastebin>http://paste.ubuntu.com</pastebin>
    <author>theNameUsedInThePost</author>
    <format>text</format>
</pastebinit>