日志项目集成:

项目说明:多台Web服务用用LVS进行负载均衡,并且多台Web服务器的apache日志由独立一台日志服务器来记录到syslog日志中。(这里主要介绍如何使用syslog日志服务远程管理apache日志)

clip_image001

∵apache本身有一套日志系统,记录在/var/log/httpd/中。现在想用独立的一台syslog日志服务器记录apache日志信息。

∴用“管道”:| logger

在各台Web服务器设置:

上加-r参数,开启远程日志管理。

[root@vm5: ~]#vim /etc/sysconfig/syslog

—————————————————–前略———————————————————–

SYSLOGD_OPTIONS=”-m 0 -r -x注:-mMAC -r:开启远程日志 -x:不DNS

—————————————————–后略———————————————————–

apache的配置文件/etc/httpd/conf/httpd.conf中,增加| logger

[root@vm5: ~]#vim /etc/httpd/conf/httpd.conf

—————————————————–前略———————————————————–

# For a single logfile with access, agent, and referer information

# (Combined Logfile Format), use the following directive:

#

CustomLog logs/access_log combined

CustomLog “| logger -p info” combined

—————————————————–后略———————————————————–

此时,就可以在独立的syslog日志服务器上,查看到各台Web服务器的日志了!!!

原创文章,转载请注明: 转载自TQ 试用 WP

本文链接地址: 日志项目集成

Post Footer automatically generated by wp-posturl plugin for wordpress.

Most Commented Posts