RSYSLOG : How to use debug on demand?

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.

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s