2018-04-23 "Bird Brother's Linux private cuisine Basic Study (Fourth Edition)" chapter 19th, understanding and analyzing log file notes

Source: Internet
Author: User

Common Log files:
/var/log/boot.log has
/var/log/cron has
/VAR/LOG/DMESG has
/var/log/lastlog has
/var/log/maillog or/var/log/mail/* have, mail no
/var/log/messages has
/var/log/secure has
/var/log/wtmp,/var/log/faillog, Faillog No.
/var/log/httpd/*,/var/log/samba/* No, Samba has
/var/log/directory files per record format:
? The date and time the event occurred;
? The hostname of the event that occurred;
? The service name that initiates this event (such as SYSTEMD, CROND, and so on) or instruction and function name (such as Su, login.);
? The actual data content of the message.


The services and programs that are required for the log file are:
? Systemd-journald.service
The main recipient of the message, provided by SYSTEMD.
Record all information during the boot process, including startup service and service failure, etc., put in memory, after reboot, the log file information before boot is not recorded.
Configuration file main reference/etc/systemd/journald.conf content

? Rsyslog.service
Information about services such as the main log system and network. In order to join the SYSTEMD control, so the RSYSLOGD developer designed the startup service script settings!
Absolute path:/usr/lib/systemd/system/rsyslog.service.
? RSYSLOGD: Service. In order to achieve the actual classification of information developed a set of software, so, this is the most basic daemon program! Used to record previous and present data into a disk file. Profiles for various services and messages recorded in certain files:/etc/rsyslog.conf. The format of the/etc/rsyslog.conf file is "service name [. =!] The file name or device or host of the message level message record.
? Syslog This is the Linux core provided by the login file design guidelines, all the requirements are probably written humanely a header file named Syslog.h case. If you want to develop software related to the login file, then you have to follow the requirements of this syslog function to design! You can use the man 3 syslog to query the relevant data!

? Logrotate
Mainly in the rotation of the log file function.
Parameter configuration file:
/etc/logrotate.conf. The main parameter file. The format is:
Absolute path file name of the login ... {
Individual parameter setting values, such as monthly, compress, etc.
}
Found: The wtmp in the/etc/logrotate.conf file is: Log the account information of the person who logged in the system correctly
/etc/logrotate.d/. All files in this directory will be actively read into the/etc/logrotate.conf.

TODO: File diagram


JOURNALCTL command: Observe the login information, check the Systemd-journald.service data
The actual operation is not the same as in the book:
No journal files were found.
--No Entries--

Logger command

2018-04-23 "Bird Brother's Linux private cuisine Basic Study (Fourth Edition)" chapter 19th, understanding and analyzing log file notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.