Home > Article > Operation and Maintenance > Where are linux server logs generally placed?
Linux server logs are generally in: 1. /var/log/ directory, which contains most of the log files of the system and services; 2. /var/log/nginx/, when Nginx is used as a web server; 3. / var/log/apache2/ or /var/log/httpd/, when Apache is used as a web server; 4. /var/log/mysql/ or /var/log/mariadb/, when it is a MySQL or MariaDB database server.
The operating system of this tutorial: Linux5.18.14 system, Dell G3 computer.
On Linux servers, common log files are generally stored in the following locations:
1, /var/log/:
This directory Contains most log files for systems and services. Some of the common log files include:
/var/log/messages: The overall log messages of the system, including records of kernel, services, and other important events.
/var/log/syslog: System log file, containing messages from system programs and services.
/var/log/auth.log: Authorization and authentication related logs, recording user login, su command and other information.
/var/log/dmesg: Kernel ring buffer messages, including startup information during boot.
2./var/log/nginx/:
If you use Nginx as a web server, related log files are usually stored here Under contents.
3, /var/log/apache2/ or /var/log/httpd/:
If you use Apache as a web server, related log files are usually stored in this directory.
4, /var/log/mysql/ or /var/log/mariadb/:
If you use MySQL or MariaDB database server, the relevant log files are usually stored in this directory.
Please note that the specific log file location may vary depending on Linux distribution, application and configuration. In some cases, you may need to view the corresponding configuration file to determine the location of the log files. In addition, you can also use commands such as journalctl to view system logs and service logs.
The above is the detailed content of Where are linux server logs generally placed?. For more information, please follow other related articles on the PHP Chinese website!