/var/log/messages中没有日志

 修改syslog配置文件并重启

sudo vi /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
重启日志服务:sudo systemctl restart rsyslog
sudo tail -f /var/log/messages  发现有输入信息了 

centos7默认$ModLoad imklog # reads kernel messages (the same are read from journald)是注释的

  

posted @ 2024-12-02 10:05  潇潇暮鱼鱼  阅读(131)  评论(0)    收藏  举报