Ubuntu System log configuration/var/log/messages
1. Problem Description
You need to view the system log file today, but cannot find the/var/log/messages file. You need to configure/etc/syslog. conf. Syslog uses a configurable and unified system registration program to receive log requests from all over the system at any time, and then according to/etc/syslog. pre-configured in conf to write log information into the corresponding file, mail it to the specific user, or send it directly to the console as a message.
Okay, the problem is coming again. There is still no/etc/syslog. conf in the system. After some searches, the final conclusion is: In Ubuntu, the corresponding values should be/etc/rsyslog. conf and rsyslogd.
2. Solution
For details about the syslog. conf file and the file function in syslog. d, refer to the following article:
Http://blog.csdn.net/jeanphorn/article/details/45166633
By viewing the rsyslog. conf file, it is found that all the configuration files are in the/etc/rsyslog. d/folder.
# /etc/rsyslog.conf Configuration file for rsyslog.## For more information see# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html## Default logging rules can be found in /etc/rsyslog.d/50-default.conf… …## Include all config files in /etc/rsyslog.d/#$IncludeConfig /etc/rsyslog.d/*.conf
Use vim to open the/etc/rsyslog. d/50-default.conf file and add the following line:
*. Info; mail. none; authpriv. none; cron. none/var/log/messages
Restart the system and check the system logs. The system is okay !!! Pai_^