VMx

vmx.im
啥都学一点的填坑人
  1. 首页
  2. Linux
  3. 正文

syslog,daemon.log 大量占用空间的办法

2023年5月10日 1075点热度 0人点赞 0条评论

如果程序大量使用 system daemon 启动会产生大量及重复的日志,很快就会将硬盘给占满。
这两个文件的写入是依赖 /etc/rsyslog.conf这个文件配置来进行记录的。
debian 默认配置:

# syslog daemon.log 日志收集配置
 *.*;auth,authpriv.none  -/var/log/syslog
 daemon.*                  -/var/log/daemon.log

可以将. 和 daemon.后面的替换成类似 *.=info 日志info级别, 来大大减小空间占用。

日志的级别有:
debug
info
notice
warning, warn (same as warning)
err, error (same as err)
crit
alert
emerg, panic (same as emerg)

Post Views: 1,020
标签: daemon rsyslog syslog
最后更新:2023年5月10日

huifei

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2021 vmx.im. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang