3

I followed the directions from: http://www.rsyslog.com/doc/debug.html

I put the following in /etc/rsyslog.conf:

$DebugLevel 2
$DebugFile /root/RSYSLOG.txt

then I try:

kill -USR1 `cat /var/run/syslogd.pid`
kill -USR2 `cat /var/run/syslogd.pid`

It appears there isn't a rsyslogd.conf.

I check the RSYSLOG.txt, it remains 0 bytes in size. I don't know what else to do.

2

This article should show how the "debug on demand" function works in rsyslog. It has been tested and verified with rsyslog 6.1.0 (v6-Devel) on Fedora 13 (steps may vary on different OS). It is assumed, that rsyslog is already working on the system. On notes regarding the installation and configuration, please take a look at the documentation. Debug on Demand is available since version 4.5.7.

To get this option working, we need to enable it first. This is done by enabling it and specifying a path for the debug log file. Open up a terminal with root rights and use the following commands:

export RSYSLOG_DEBUG="DebugOnDemand NoStdOut"
export RSYSLOG_DEBUGLOG=/somepath/example.log

The first option enables the "debug on demand" itself without standard output. This is necessary to have it disabled when starting the service. The second option specifies the path and name of the log file.

Now we have to stop the rsyslog service, before we are ready. Use the following command:

/etc/rc.d/init.d/rsyslog stop

We have now stopped the service and need to start it again. In the current configuration we need to start rsyslog as a foreground application. Due to it being much simpler to configure it this way, rsyslog needs to be a foreground application for "debug on demand" to work instead of a background service. Start it again as foreground application with the following command:

rsyslogd -n

Open up a second terminal (again with root) so we can enable or disable the "debug on demand". Use this command:

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

Using this command once will enable the debug mode. Using it again will disable it. Please note that you definately need "-USR1″ else the rsyslog will be really killed. Further make sure to use the backticks. These are important.

That’s it basically. You can now review your "debug on demand" log files.

| improve this answer | |
1

I tried to use the Debugging method above in the rsyslog.conf file but just got errors in the logs about $DebugFile etc. not being recognised as a command.

My solution was to follow the process detailed for on demand debugging here.

It's a bit long winded but at least it worked.

| improve this answer | |
  • 1
    This is crap, just like the rest of rsyslog's documentation. Didn't work for me. And this simply doesn't work if you want to know how things are going on while rsyslog is loading, i.e. if you want to know how rsyslog reacts to what is written in the configuration file. – OmarOthman Jul 6 '16 at 14:48
  • @OmarOthman I feel the pain... – confiq Mar 20 '18 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.