Linux8.7 Linux system logs

Source: Internet
Author: User
Tags system log

Linux syslog, System log, logs, system, network, kernel, service, etc.

[Email protected] ~]# cat/var/log/messages

Imagine that if all the operating contents of the system are recorded in the file, it will cause the file to be too large and how to avoid it.

[[email protected] ~]# du-sh! $du-sh/var/log/messages228k/var/log/messages# found the log is not large [[email protected] ~] # ls/var/log/messages*/var/log/messages/var/log/messages-20180121/var/log/messages-20180108/var/log/messages -20180130/var/log/messages-20180119# prevents the log from being added indefinitely, setting up a log cutting tool. Logrotate[[email protected] ~]# cat/etc/logrotate.conf# see ' Man logrotate ' for details# rotate log files weekly weekly cut Cut weekly# Keep 4 weeks worth of backlogs reserved 4 rotate 4# Create new (empty) log files after rotating old ones create a file create# us E date as a suffix of the rotated file suffix name dateext# Uncomment this if you want your log files compressed whether compressed #compress# Tells Logrotate to read the log dump parameters stored in the/ETC/LOGROTATE.D directory, which is useful when the RPM package is installed in the system. The log dump parameters for RPM packages are generally stored in the/ETC/LOGROTATE.D directory. # RPM Packages Drop log rotation information into this directory include/etc/logrotate.d# no packages own wtmp and btmp --we ' ll rotate them here/var/log/wtmp {monthly Create 0664 root utmp minsize 1M   Rotate 1}/var/log/btmp {Missingok monthly create 0600 root utmp rotate 1}# system-specific logs may be ALS O is configured here.

Reference https://my.oschina.net/u/2000675/blog/908189

  

Dmesy command, hardware run log. is not associated with/VAR/LOG/DMESG, the file is logged by the system startup.

Last command to view the correct login and restart history. Call is/var/log/wtmp, the binary file cannot be cat

LASTB command to view the history of login failures. The call is/var/log/btmp and cannot be cat

Security log/var/log/secure will record some information such as brute force cracking.

  

Linux8.7 Linux system logs

Related Article

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.