Linux Log System Overview-Linux general technology-Linux technology and application information, the following is a detailed description. The main function of logs is to monitor the system status in real time, and monitor and track intrusions. Linux has three major log subsystems: connection time logs, process statistics logs, and error logs.
The connection time logs are recorded in/var/log/wtmp and/var/run/utmp to track who is logged on to the system at the time.
The process Statistics log (pacct or acct) provides command usage statistics for basic services in the system.
Error logs are recorded by syslogd background processes. Various system Daemon Processes and user programs call the function syslog To record noteworthy events to the file/var/og/messages.
In addition, applications can also create logs, such as HTTP and FTP, which are commonly used to keep detailed log information. The audit system usually stores the security audit information in the audit. log file under the/var/log/audit. d directory.
Common log files are described as follows:
Boot. log records system events during boot.
Cron records the actions of child processes derived from crontab daemon crond.
Maillog records email activity.
Acct/pacct records user commands.
Lastlog records the last successful logon events and the last unsuccessful logon events.
Messages records information from syslogs (some links to the syslog file ).
Sulog records the use of the su command.
Syslog records information from syslog (usually linked to the messages file );
Utmp records the information of the currently logged-on user.
A permanent record of the entry and exit times of a user in wtmp. In addition, wtmp and utmp files are binary files. You need to use the who, w, users, last, and ac commands to view the information they contain.
Process statistics record the activity of the process. Process statistics are disabled by default. Use the following command to enable process Statistics:
# Accton/var/log/pact
The command to disable process statistics is as follows:
# Accton
The lastcomm command can be used to report the contents of previous execution files recorded in/var/log/pacct.
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