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--
Editor to share with you linux operation and maintenance log files of the common log files, what is the management of log files, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Almost all services on linux have log files, which are used to record the running status of the software. Through the log file, we can get a lot of useful information, for example, through the log file of nginx, we can count the daily number of IP, PV and so on. In addition, if there is a problem with the operation of the software, we can also use the log file information to locate the source of the error. Therefore, log files are also an important part of the software.
Common log files
In the linux system, many useful log files are recorded in the / var/log/ directory.
/ var/log/cron records information related to scheduled tasks
/ var/log/dmesg boot kernel information
/ var/log/btmp records incorrect login information. This file cannot be viewed through vi, but can be viewed with the lastb command.
/ var/log/lastlog records the last login of each user. This file cannot be viewed through vi. Use the lastlog command to view it.
/ var/log/maillog records email information
/ var/log/message records the important information of the system
/ var/log/recure records authentication and authorization information, as long as programs involving accounts and passwords
/ var/log/wtmp permanently records the login and exit information of the user, in addition to recording the shutdown, restart and boot information. Use the last command to view
/ var/log/ulmp records the current login user information. You can use the w, who commands to view
Services related to log files
With regard to the generation of log files, there are mainly two ways, one is that the software itself generates log information, such as apache and nginx software, and the other is to generate log information through the log related services of linux system. For system management log software, there are three main ones:
Systemd-journald.service
Rsyslog.service
Logrotate
Basically, with systemd-managed services, some information generated during startup and operation will be recorded by systemd-journald in binary format (stored in memory), and then sent to rsyslog for further recording. For the logrotate service, it is used to cut and rotate logs to prevent the problem of excessive size of a single log file and too many log files.
Therefore, the division of labor for the above three services is as follows: first, the systemd-journald obtains the information and records it in memory, then sends the information to rsyslog,rsyslog and stores the information in the log file. Finally, the log file is managed alternately using logrotate.
The above are the common log files of linux operation and maintenance, what is the service for managing log files, thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.