Monday, January 18, 2010

patterndb on lwn.net

Robert wrote an excellent article for lwn.net on patterndb: Log message classification with syslog-ng. It is worthwhile reading it!

Wednesday, January 6, 2010

slngctl: syslog-ng debug, trace and statistics utility

PZolee wrote a quite lengthy blog post on troubleshooting and debuging syslog-ng back in December 2009. It popped into my mind that running syslog-ng with debug/trace/verbose option enabled is very handy, but sometimes you do not want to stop syslog-ng just to restart it in a more verbose mode. My idea was to enable syslog-ng to real-time modify these verbosity settings through the control socket which is currently only used for exporting statistical information.

I extended the control socket communication to have the ability of modify these logging settings. To make life easier I have created a small utility called slngctl which can be used to communicate with the running syslog-ng process. Using slngctl it also easy to query the statistics collected by syslog-ng. Also on longer term I think other useful small features could be added the slngctl.

slngctl commands:


marci@octane:$ slngctl
Possible commands are:
stats Dump syslog-ng statistics
verbose Enable/query verbose messages
debug Enable/query debug messages
trace Enable/query trace messages


Querying statistics:


marci@octane:$ slngctl stats
destination;d_out;;a;processed;0
global;payload_reallocs;;a;processed;0
source;s_tcp;;a;processed;0
global;msg_clones;;a;processed;0
global;sdata_updates;;a;processed;0
center;;received;a;processed;0
center;;queued;a;processed;0


Getting current verbose settings:

marci@octane:$ slngctl verbose
VERBOSE=1


Enabling trace run-time:

marci@octane:$ slngctl trace
TRACE=0
marci@octane:$ slngctl trace -s 1
marci@octane:$ slngctl trace
TRACE=1


As always you can find the source code in my 3.1 git repository and all feedbacks are very welcome.