Understanding and analyzing log files in Linux

1. The log file can record four pieces of information about when, where, who and what happened to an event, so be sure to query the log file when there is a problem with the system

2. The log files of the system are centrally placed in the /var/log directory by default, and the message records the most information.

3. The main services and programs recorded in log files are syslogd, klogd, log

4. The configuration file of syslogd is in /etc/syslog.conf, the content syntax is: service.level record device or file

5. syslogd itself has the function of providing a log file server, which can be achieved by modifying the content of /etc/sysconfig/syslog

6. The logrotate program uses crontab to rotate log files

7. The configuration file of logrotate is /etc/logrotate.cong, and additional settings can be written in /etc/logrotate.d/*

8. Log file analysis software: logwatch

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689665&siteId=291194637