views:

269

answers:

3

Hello,

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

In order to send Apache 2.2 error log we followed instructions found on the here: http://wiki.rsyslog.com/index.php/Working_Apache_and_Rsyslog_configuration

It works, but the included perl script is very inefficient - it takes huge part of the system resources and from looking at the Sys::Syslog::syslog subroutine I can imagine why - it does lots of parameter parsing and moving around before it actually sends the message.

Is there some efficient C/C++ program to replace this script? It seems to be a 5-liner but I'd rather not re-invent the wheel.

Other solutions to efficiently send apache ERROR logs to syslog would also be welcome.

Thanks.

A: 

I'v written a C program which does the same function as the perl script in the link above. It seems to take much less resources. The program's source code was uploaded to the link in my question.

Amos Shapira
A: 

Thanks
It was useful :)

A: 

Actually it's pretty redundant - the "logger" command line utility will read standard input and send each line to syslog if it is not passed a message on the command line.

You are welcome anyway....:)

Amos Shapira