Log file/Advanced

From Official Kodi Wiki
< Log file
Revision as of 05:24, 24 May 2009 by >Althekiller (New page: At some point during your foray into XBMC, you will likely come up against a problem that isn't made 100% clear from errors in the GUI. This is where the log file comes into play. XBMC w...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

At some point during your foray into XBMC, you will likely come up against a problem that isn't made 100% clear from errors in the GUI. This is where the log file comes into play. XBMC writes all sorts of useful stuff to its log, which is why it should be included with every bug/problem report. Don't be afraid of its contents! Often a quick glance through the log will turn up a simple typo or missing file which you can easily fix on your own.

Log Files

  • xbmc.log - This is the log file of most recent (or currently running) XBMC session.
  • xbmc.old.log - This is the log file from the last XBMC session. If XBMC crashes AND you have restart it before viewing the log, this is the one you want.

Location

Both xbmc.log and xbmc.old.log are located in special://temp. See Special protocol for where exactly this is on your platform

Layout

Each event is logged to one line of the XBMC log file which is formatted as follows...

[TIMESTAMP] T:[THREADID] M:[FREEMEM] [LEVEL]: [MESSAGE]
  • TIMESTAMP - The wall time at which the event occurred.
  • THREADID - The thread identification number of the thread in which the event occurred.
  • FREEMEM - The amount of memory free at the time of the event.
  • LEVEL - The severity of the event.
  • MESSAGE - A brief description and/or important information about the event.

Log Levels

There are two different types levels when talking about the XBMC log. The first is the severity of event that has occurred. The second controls which severity levels are actually printed out to the log.

Severity Levels

In order from least to most severe...

  • DEBUG - In depth information about the status of XBMC. This information can pretty much only be deciphered by a developer or long time XBMC power user.
  • INFO - Something has happened. It's not a problem, we just thought you might want to know. Fairly excessive output that most people won't care about.
  • NOTICE - Similar to INFO but the average Joe might want to know about these events. This is level and above are logged by default.
  • WARNING - Something potentially bad has happened. If XBMC did something you didn't expect, this is probably why. Watch for errors to follow.
  • ERROR - This event is bad. Something has failed. You likely noticed problems with the application be it skin artifacts, failure of playback a crash, etc.
  • FATAL - We're screwed. XBMC is about to crash.

Log File Control Levels

In order from least to most information provided...

  • None - No logging will occur. xbmc.log will likely be created but should remain empty.
  • Normal - The default loglevel. Events with a severity of NOTICE or greater will be logged.
  • Debug - All events are logged. This is the only level that you should bother someone else with.
  • Debug w/ Visuals - Same printed log as Debug, but free memory and CPU usage are rendered on the screen as well.
  • SMB Debug - Same as Debug w/ Visuals with the addition of ridiculous amounts of Samba debugging info. Use this only if asked.

Enable Debugging

There are two ways to control log output.

GUI Setting

In Settings > System there is a setting Enable debug logging. This lets you toggle between Normal and Debug w/ visuals on the fly. NOTE: This option is hidden if you have set the log level in advancedsettings.xml.

AdvancedSettings.xml

You can set any of the five log file#log file control files using the <loglevel> tag in advancedsettings.xml. See advancedsettings.xml#loglevel for details. Setting debug level like this will hide the GUI setting.