自定义程序写syslog的步骤

类别:软件工程 点击:0 评论:0 推荐:
1。修改/etc/syslog.conf。local0-local7用户可以自定义。下面是一个实例:
*.info;mail.none;authpriv.none;cron.none;local3.none;local4.none;local5.none;local6.none /var/log/messages

# The authpriv file has restricted access.
authpriv.*                      /var/log/secure

# Log all the mail messages in one place.
mail.*                          /var/log/maillog

# Log cron stuff
cron.*                          /var/log/cron

# Everybody gets emergency messages
*.emerg                         *

# Save news errors of level crit and higher in a special file.
uucp,news.crit                      /var/log/spooler

# Save boot messages also to boot.log
local7.*                        /var/log/boot.log

#test1
local3.*                       /test1/log/test1msg.log
local4.*                        /test1/log/test1err.log

#test2
local5.*                        /test2/log/test2msg.log
local6.*                        /test2/log/test2err.log

2。然后重启syslogd使其生效。killall  -HUP  syslogd。就可以了。

本文地址:http://com.8s8s.com/it/it31912.htm