服务器日志问题

服务器日志问题

我有一台运行 Debain 的 Linux 服务器。我的日志未在 var/log/messages 中更新。守护进程 syslogd 正在运行。以下是我在 var/log/messages 中更新的日志。

Apr xx 20:40:24 xxxxx -- MARK --
Apr 16 22:40:26 xxxxx -- MARK --
Apr 16 23:00:26 xxxxx -- MARK --

xxxxx 替换为服务器主机名。

有人能帮我解决这个问题吗?

答案1

尝试logger -p user.notice -t test one two three

然后sudo tail /var/log/messages

通过发布输出来更新您的答案grep -v ^# /etc/syslog.conf

答案2

# grep -v ^# /etc/syslog.conf


auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
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
uucp.*                          /var/log/uucp.log

mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

news.crit                       /var/log/news/news.crit
news.err                        /var/log/news/news.err
news.notice                     -/var/log/news/news.notice

*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

*.emerg                         *


daemon.*;mail.*;\
        news.crit;news.err;news.notice;\
        *.=debug;*.=info;\
        *.=notice;*.=warn       |/dev/xconsole

相关内容