In ECS Linux systems, log files are very important files that record important things in many systems. Common log files in Linux systems are outlined below:
- /var/log/cron
You can check the cron file for the actual execution of the CRONTAB task schedule, whether the execution occurred incorrectly, and whether the/etc/crontab file has a syntax error or a write error.
- /var/log/dmesg
In the DMESG file, you can check the information generated by the kernel detection process at boot time, including system device information, as well as any errors and problems recorded by the system during startup and operation. The DMESG file can be used to determine whether certain hardware devices (such as disks) are correctly identified during system startup.
- /var/log/lastlog
You can check the Lastlog file for information about the last time you logged in to the system for all the accounts on the system.
- /var/log/messages
You can check the messages file for the majority of the system error messages, if the system has some unknown errors, it is recommended that customers first check the messages file. The changes in the system can be viewed in real time via Tail-f/var/log/messages. The default log for Iptables is/var/log/messages.
- /var/log/secure
All software or programs that involve the need to enter an account password will be logged to the secure file, such as the login program of the system, Su, sudo, ssh, Telnet, POP3, FTP, and so on when logging in (whether the login succeeds or fails).
- /var/log/wtmp
You can check the account information of the correct login system in the Wtmp file. Since the wtmp file is already encoded, the last instruction is required to remove the contents of the file, and the file cannot be viewed directly with a command such as Cat.
Introduction to common Log files in ECS Linux systems