---
layout: docs
title: Logfiles
breadcrumb: [ "advanced.html", "Advanced" ]
---


== Logfiles

Logfiles are usually in `/var/log/thruk/thruk.log`. If you use OMD, then
the logfiles are in `~/var/log/thruk.log`.

Cronjobs have their own logfile in `~/var/thruk/cron.log` for OMD or
`/var/lib/thruk/cron.log` for standalone installations.


== Logfile Configuration

Logging configuration takes place in the log4perl.conf. You can do whatever is
possible in log4perl. Refer to the log4perl manual for detailed
information:
http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/Config.html
There is a log4perl.conf.example file shipped with the package.

ex.:

 log4perl.logger=ALL, ErrorLog, DebugLog
 log4perl.appender.ErrorLog=Log::Dispatch::File
 log4perl.appender.ErrorLog.filename=/home/thruk/Thruk/logs/error.log
 log4perl.appender.ErrorLog.mode=append
 log4perl.appender.ErrorLog.Threshold=ERROR
 log4perl.appender.ErrorLog.layout=Log::Log4perl::Layout::PatternLayout
 log4perl.appender.ErrorLog.layout.ConversionPattern=[%d][%H][%p][%c] %m%n


[TIP]
.command logging
=======
if you want to log all sent commands, just set the loglevel to INFO.

ex.: log4perl.appender.ErrorLog.Threshold=INFO
=======


== Enable Debug Logging

To get more verbose log output, you have to create a `.thruk` file in the
home directory of the Thruk user (usually the webserver user) or in case of
OMD in the site folder.

The following locations will work depending on your setup:

 - ~/.thruk
 - /etc/sysconfig/thruk
 - /etc/default/thruk

Then put in the following settings inside:

to increase the loglevel: (valid loglevels are 0-4 with 4 being most verbose)

  export THRUK_VERBOSE=4

to track all requests with their cpu and memory usage:

  export THRUK_PERFORMANCE_DEBUG=1


.increase log threshold
=======
NOTE: You also have to adjust the loglevel threshold in `/etc/thruk/log4perl.conf`.

ex.: log4perl.appender.ThrukLog.Threshold=DEBUG

Also some log output will end up in the apache errorlog.
=======
