In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The function of log
Used to record all kinds of events that occur during the operation of the system and the program.
By reading the log, it is helpful to diagnose and solve the system failure.
Classification of log files
Kernel and Syslog:
It is managed by the system service syslog, and the log format is basically similar.
User log:
Record information about system users logging in and logging out of the system
Program log:
Log files independently managed by various applications with inconsistent recording format
Log save location
By default, it is located in: / var/log directory
Main log file log file directory log file introduction / var/log/messages kernel messages and various applications / var/log/cron records crond scheduled task production information / var/log/dmesg records various event information of the Linux system during boot / var/log/maillog records enter or send out system email activity / var/log/lastlog records each user's most recent login event / var / log/secure records security event information related to user authentication / var/log/wtmp records each user login, Logout and system startup and downtime events / var/log/btmq logging failed, erroneous login attempts and authentication event log messages warning level warning content 0EMERG (urgent) will cause the host system to be unavailable 1ALERT (warning) problems that must be addressed immediately 2CRIT (serious) more serious cases 3ERR (error) running error 4WARING (reminder) may affect system function Need to provide the user's important event 5NOTICE (note) will not affect the normal function, but need to pay attention to the event 6INFO (information) general information 7DEBUG (debugging) program or system debugging information user log file
In wtmp, btmp, lastlog and other log files, the system user login, logout and other related event messages are saved. However, these files are binary data files, which can not be browsed directly by text viewing tools such as tail and less, but need to use user query commands such as who, w, users, last and lastb to obtain log information.
(1)-- query the status of current users logged in-- users, users, w commands
Users: simply output the name of the user currently logged in, with each displayed user name corresponding to a login session
Who: used to report each user information in the currently logged-in system
W: used to display each user in the current system and the process information they are running, which is richer than the output of users and who commands.
(2) query the history of user login-last, lastb commands
Lastb: used to query the records of users who failed to log in, such as incorrect user name and incorrect password.
Last: used to query the records of users who successfully logged in to the system. The most recent login will be displayed at the top.
Program log
In the Linux operating system, there are still a considerable number of applications that do not use rsyslog services to manage logs, but rather maintain their own log records. For example, the httpd Web Service uses two log files, access_log and error_log, to record customer access events and error events, respectively.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.