Centos – How to get perl stderr to httpd log file when using syslog

apache-2.2centosloggingperlsyslog

This question is about HTTPD (Apache) 2.? on centOS and modperl 1.7+

When I use the apache directive ErrorLog logs/error_log, my perl warnings show up in the error_log file. When I change this to ErrorLog syslog:local1, no perl warnings show up in the syslog target. My question is, how do I remedy this?

(syslog reads: local1.* /var/log/httpd_error)

Current Apache docs say this

A very wide variety of different messages can appear in the error log. Most look similar to the example above. The error log will also contain debugging output from CGI scripts. Any information written to stderr by a CGI script will be copied directly to the error log.

Old Apache (1.3) docs talk about something called HookStderr and stderr being sent to /dev/null. I tried using this and configtest fails.

I also looked around CPAN but didn't find anything obviously useful in this situation.

Has anyone done this?

(I originally posted this on stack overflow but there wasn't much response)

Best Answer

Looks like to can't do it directly but rather would need to do something like

ErrorLog "| logger -p local3.debug"

Related Topic