久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

幫助中心 >  技術知識庫 >  云服務器 >  服務器教程 >  CentOS 7不收集日志或不存在 /var/log/messages

CentOS 7不收集日志或不存在 /var/log/messages

2019-06-04 16:21:54 11085

前一直有日志生成,正常運行,日志突然不收集 ,最后一次輪替日志之后,/var/log/message, /var/log/secure等都不記錄了,并且都是空文件。

背景

重啟機器:reboot 無效

重啟日志: systemctl start rsyslog 無效

懷疑空間不足,刪除/var/log/messages,重新運行rsyslog 無效

重裝下rsyslog,于是yum reinstall rsyslog,重新運行rsyslog 無效

Solution

找到配置文件 /etc/rsyslog.conf

修改如下:

解注釋:#$ModLoad imklog # reads kernel messages (the same are read from journald)

修改為:$ModLoad imklog # reads kernel messages (the same are read from journald)


增加注釋:$OmitLocalLogging on

修改為:#$OmitLocalLogging on


增加注釋:$IMJournalStateFile imjournal.state

修改為:#$IMJournalStateFile imjournal.state


重啟日志:systemctl restart rsyslog

tai日志:tail -f /var/log/messages 可以了

注意默認centos7是注釋掉#$ModLoad imklog # reads kernel messages (the same are read from journald)這段的


提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: