Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 152010

Sending Apache log to syslog?


In the Apache config (httpd.conf), add/modify the followings as needed

1. For Access log

CustomLog |/usr/local/apache/bin/apache_syslog combined

Where apache_syslog is a Perl script

use Sys::Syslog qw( :DEFAULT setlogsock );

openlog('apache', 'cons', 'pid', 'local2');

while ($log = ) {
            syslog('notice', $log);

2. For Error log

Apache already has direct support error log to syslog, so just add the target syslog facility.

ErrorLog syslog:local1

This tells Apache to send the error log output to the syslog facility local1

Dec 252009

Why am I seeing "-- Mark --" in my syslog?


This is a timestamp which is automatically generated by syslogd, and is syslogd's way of stating that it has nothing to report. The default interval between two -- MARK -- lines is 20 minutes.

This can be changed by locating the syslodg startup script, and changing the parmeter after the "-m" option to suit your needs. To disable these timestamps completely, set "-m" to 0. For more information, type "man syslogd".