|
Linux in the log for connection time, generally by / var / log / wtmp and / var / run / utmp file records the two, but both files can not directly use cat to view, and the file is automatically updated by the system, we can by w, who, finger, id, last, lastlog, ac command to view it.
Linux in the log for monitoring the process, said first process monitoring log monitor the user's operation instruction is very effective when the server recently discovered often happens for no reason or for no reason downtime being deleted files and so on, through the use of statistical process logs View. We use accton / var / account / pacct to open the log monitoring process statistics, we can see the process to use lastcomm statistics log situation.
Linux in the log by a service called syslog service management, such as syslog logging service drive a lot of files, such as / var / log / lastlog record is the last time the user successfully landed, the landing of IP information, and / var / log / messages are recorded Linux operating system, common systems and services error message, and / var / log / secure is recorded Linux system security log records users and groups transform, the user login authentication information, and / var / log / btmp login failure is recorded Linux user, time, and the remote IP address, and / var / log / cron is the implementation of the plan of record tasks.
The syslog service consists of two important configuration files control and management, which are the main configuration file /etc/syslog.conf and / etc / sysconfig / syslog auxiliary profile and /etc/init.d/syslog is a startup script.
When the system works to a certain time, the log file with time and increase traffic while more and more, the log file will be growing, when the log file exceeds the scope of the control system when the system will be performance impact. Dump can be set to annually dump dump monthly, weekly dumps, dumps up to a certain size.
On Linux systems, we often use logrotate to dump logs, combined with cron scheduled task, you can easily dump dump way of setting log files have /etc/logrotate.conf profile control. |
|
|
|