Effective logging stdin with rsyslog

Our environment: CentOS 5, which comes with Apache 2.2 and rsyslog 2.0.6

To submit the Apache 2.2 error log, we followed these instructions: http://wiki.rsyslog.com/index.php/Working_Apache_and_Rsyslog_configuration

This works, but the included perl script is very inefficient - it takes up a huge portion of system resources and looks at the Sys :: Syslog :: syslog routine. I can imagine why - it does a lot of parsing parameters and moving around before it actually sends a message.

Is there an effective C / C ++ program to replace this script? It seems to be 5ft, but I would prefer not to reinvent the wheel.

Other solutions will also be welcome to allow the efficient sending of apache ERROR logs to syslog.

Thanks.

+4
source share
2 answers

This is actually quite redundant - the command line utility "logger" reads standard input and sends each line to syslog if it is not passed on the command line.

Welcome anyway .... :)

+3
source

I wrote a C program that performs the same function as the perl script in the link above. It seems to have far fewer resources. The source code of the program was uploaded to the link in my question.

+2
source

All Articles