我正在运行 SUSE Linux Enterprise Server 10 SP2 (SLES10 SP2),并且看到大量的支持称之为修饰错误的内容被记录到 /var/log/messages。
有谁知道更改 /var/log/messages 文件中日志级别的方法吗?
当然,编辑/etc/syslog.conf
(或/etc/rsyslog.conf
取决于发行版)。有一条线
*.=info;*.=notice;*.=warning;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
Run Code Online (Sandbox Code Playgroud)
删除 *.=notice 或 *.=info 或根据需要调整它。
$ man syslog.conf
Run Code Online (Sandbox Code Playgroud)
将为您提供所有可以使用的选项。
不要忘记重新启动 syslog 守护进程以使更改生效。