How to configure /var/log/messages in Ubuntu system log

1. Problem Description

Today I need to check the system log file, but the file /var/log/messages was not found. Searching for information on the Internet, it is said to configure /etc/syslog.conf. syslog adopts a configurable and unified system registration procedure, accepts log requests from all parts of the system at any time, and then writes the log information into the corresponding file according to the preset in /etc/syslog.conf, mails it to a specific user or directly The message is sent to the console.

Okay, here comes the problem again. There is still no /etc/syslog.conf in the system. After some searching, the final conclusion is that the corresponding ones under Ubuntu should be /etc/rsyslog.conf and rsyslogd.

2. solution

For syslog.conf file and file function explanation under syslog.d, please refer to the following article:

https://www.zalou.cn/article/164470.htm

By looking at the rsyslog.conf file, it is found that all 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 

Open the /etc/rsyslog.d/50-default.conf file with vim and add a line as follows:

*. info;mail.none;authpriv.none;cron.none /var/log/messages 

Restart the system, check the system log again, and find that it is okay! ! ! ^_^

The above Ubuntu system log configuration method /var/log/messages is all the content shared by the editor, I hope to give you a reference.

Recommended Posts

How to configure /var/log/messages in Ubuntu system log
How to configure TensorFlow use environment in Ubuntu
How to use dpkg command in Ubuntu system
How to open the ubuntu system in win10
How to use Putty to log in to ubuntu installed in VirtualBox
How to modify time zone and time in ubuntu system
How to install Helm in Ubuntu
How to use hanlp in ubuntu
How to install mysql in Ubuntu 14.04
How to install mysql in Ubuntu 14.04
How to control the ubuntu system in win10 through ssh
How to easily compile openJDK in Ubuntu
How to install cuda10.1 driver in Ubuntu
How to add users to Sudoers in Ubuntu
How to delete redundant kernels in Ubuntu
How to delete redundant kernels in Ubuntu
How to configure Redis cluster on Ubuntu 14.04
How to install ROS Noetic in Ubuntu20.04
How to set static IP in ubuntu14.04
How to modify software source in Ubuntu 7.10
How to open root account in Ubuntu20.04
How to configure Redis replication on Ubuntu 16.04
How to hide applications in Ubuntu Dash?
How to install and configure NATS on Ubuntu 16.04
How to install and configure Gogs on Ubuntu 18.04
How to modify time zone and time in ubuntu
How to install and configure Cyberpanel on Ubuntu 18.04
How to install and configure ownCloud on Ubuntu 16.04
How to install and configure ownCloud on Ubuntu 16.04
How to upgrade to Ubuntu 20.04
How to install and configure GitLab on Ubuntu 18.04
How to install python in ubuntu server environment
How to install and configure Ansible on Ubuntu 18.04
How to install and configure Elasticsearch on Ubuntu 16.04
How to install and configure PostGIS on Ubuntu 14.04
How to install and configure VNC on Ubuntu 18.04
How to install and configure Sphinx on Ubuntu 16.04
How to install and configure OrientDB on Ubuntu 14.04
How to configure Apache content caching on Ubuntu 14.04
How to install and configure AppScale on Ubuntu 12.04
How to upgrade to Ubuntu 20.04
How to install and configure PostGIS on Ubuntu 14.04
How to install Hadoop in standalone mode on Ubuntu 18.04
How to configure a fixed IP based on Ubuntu 18.04
How to configure DNS for Ubuntu to make it permanent
Complete steps to configure IP address in Ubuntu 18.04 LTS
Example of how to modify ip address in Ubuntu20.04
How to install theano and keras on ubuntu system
How to create a Python virtual environment in Ubuntu 14.04
How to repair a damaged Ubuntu system without reinstalling
Teach you how to install Ubuntu system enhancement tools
How to upgrade to Ubuntu 16.04 LTS
How to create LVM for XFS file system under Ubuntu
Mac uses vnc to remotely log in to the ubuntu16.04 desktop
How to install memcache and start it in ubuntu environment
How to configure NTP to join the NTP pool project in CentOS
How to compile and install PHP and Nginx in Ubuntu environment
How to install JDK and Mysql on Ubuntu 18.04 linux system
How to map shared disk to window in linux under Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Memcached on Ubuntu 20.04