我们有一个运行Ubuntu 10.04.4 LTS的vps,在尝试找到php问题的解决方案时,我已经意识到syslog系统的问题 – 我不确定.
syslog.conf文件如下所示:
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* -/var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/opt/psa/var/log/maillog
user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info -/var/log/mail.info
mail.warning -/var/log/mail.warn
mail.err -/var/log/mail.err
# Logging for INN news system
#
news.crit -/var/log/news/news.crit
news.err -/var/log/news/news.err
news.notice -/var/log/news/news.notice
#
# Some `catch-all' logfiles.
#
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warning;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg *
#
# I like to have messages displayed on the console, but only on a Virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warning /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warning |/dev/xconsole
并且/ var / log / syslog文件包含大量条目,如下所示:
Jun 10 04:04:00 lvps109-104-93-171 postfix/qmgr[688]: 814E0676E997: removed
Jun 10 04:04:01 lvps109-104-93-171 postfix/smtpd[11105]: connect from mail-we0-f196.google.com[74.125.82.196]
/var/log/mail.info,/var/log/mail.warn,>尽管上面的配置将相关消息指向它们,/ var / log / mail.err都是空的.
我尝试将’mail.* – / var / log / mail.log’添加到conf文件中,看看我是否可以获得smtp& qmgr消息在那里重复,但该日志文件也保持为空.
我尝试将’*.*; auth,authpriv.none – / var / log / syslog’更改为*.*; auth,authpriv.none; mail.none – / var / log / syslog以查看是否可以停止任何后缀消息进入/ var / log / syslog,但它们继续到那里.
我一直在寻找年龄来找到我需要将这些后缀消息重定向到mail.log文件的命令,但我发现的帖子似乎只提到.info,.err,& .warn消息.
据我所知,syslog守护进程应该将它们指向相关文件.
所以我的问题是:
如何将后缀消息从/ var / log / syslog重定向?
为什么不是.warn,.info,& .err消息应该在哪里?
感恩的任何帮助 – 非常感谢.
我猜你在使用rsyslog?
您必须告诉rsyslog在写入相应文件后停止处理该消息.这可以用& 〜.
mail.* -/var/log/mail.info
& ~
将这些行放在包含*.*的行之前.
完成后重新启动syslog.