Tuesday, February 8, 2011

How to: Test the apache syslog with the free kiwi syslog server

Let’s say you have two OS, one in windows which will host the syslog server, and one Centos OS as the container of Apache , here is the tutorial to test the syslog logging. both on  server side (view the logs) and and client side (turn on logging to syslog)

Download and install one free version of kiwi syslog
  when you run, you will get the GUI to show and filter logs.


when the log server runs, it will listen on the UDP port 514.

on the Centos, OS level, to Point lone log facility to our kiwi log server

vi /etc/syslog.conf
#Add one line

localcal6.*        @

#restart syslog server
service syslog restart # or killall –HUP syslogd

Now, you can test the syslog setting now, by write several logs to syslog

logger –p local6.info Hello,errorlog

from the kiwi server, you will see the log

For the Apache, change the httpd.conf, to point the errorlog and accesslog to our syslog facility local6

#ErrorLog "logs/error_log"
ErrorLog syslog:local6

#access Log
CustomLog "|/usr/bin/logger -p local6.info"  combined

Restart the httpd , all logs will be dispatched to our syslog server. (here both error log and access log)


No comments:

Locations of visitors to this page