dnsmasq递归日志开启并分隔

**开启递归日志:

/etc/dnsmasq.conf

log-queries  #开启

log-facility=/etc/dnsmasqlog/dnsmasq.log #递归日志存放路径

**开启日志分割 logrotate

默认centos已经安装,如果没有yum安装

vim /etc/logrotate.d/dnsmasq

/etc/dnsmasqlog/dnsmasq.log {
daily
rotate 7
dateext
dateformat -%Y-%m-%d
missingok
notifempty
compress
delaycompress
copytruncate
}

**不需要自己配置crontable,因为默认logrotate系统配置了定时任务

/etc/cron.daily/logrotate

**直接测试,查看是否分隔成功

logrotate -f /etc/logrotate.d/dnsmasq

然后查看/etc/dnsmasqlog/ 下面是否有分割日志

版权声明:本文内容由互联网用户撰写,该文观点仅代表作者本人。本站爱分享仅提供分享服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,请立马联系本站,本站将立刻删除。
THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭