summaryrefslogtreecommitdiffstats
path: root/source/troubleshooting/howtodebug.rst
blob: 5d770ff9f7f46b0b9c2b8a0405e35fe0bdd24219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
How to create a debug log
=========================

Creating a debug log is actually quite simple. You just have to add a 
few lines to the configuration file.

Regular debug output
--------------------

Add the following right at the beginning of the rsyslog.conf file. This
will ensure that debug support is the first thing to enable when the 
rsyslog service is started:

::

	$DebugFile /var/log/rsyslog.debug
	$DebugLevel 2

The actual file path and name may be changed if required.

Having set the above, when rsyslog is restarted it will produce a continuous
debug file. 

Debug on Demand
---------------

For having rsyslog be ready to create a debug log (aka Debug on Demand), the
settings are a little different. 

::

	$DebugFile /var/log/rsyslog.debug
	$DebugLevel 1

Now, rsyslog will not create a debug log on restart, but wait for a USR signal
to the pid. When sent, the debug output will be triggered. When sent again, 
debug output will be stopped.

::

    kill -USR1 `cat /var/run/rsyslogd.pid`

Notes
-----

- Having debug output enabled, the debug file will grow very quickly. Make sure
  to not have it enabled permanently. The file will eventually fill up the disk.
- Debug mode is not to be used in a productive environment as a permanent setting.
  It will affect the processing and performance.

See Also
--------

- :doc:`Troubleshooting <../troubleshooting/troubleshoot>` doc page.
- :doc:`Debug Support<../troubleshooting/debug>` doc page with more detailed 
  information.