Common log file locations in Linux are typically found in the /var/log directory. Here are some of the most frequently used log files and their purposes:
-
/var/log/syslog: General system log that records various system events and messages.
-
/var/log/messages: Contains general system messages, including startup messages and other non-critical logs.
-
/var/log/auth.log: Logs authentication attempts and security-related events, such as login attempts.
-
/var/log/cron.log: Records cron job executions and related events.
-
/var/log/kern.log: Contains kernel-related messages and events.
-
/var/log/dmesg: Logs kernel ring buffer messages, which include hardware-related messages during boot.
-
/var/log/httpd/ or /var/log/apache2/: Contains logs for the Apache web server, including access and error logs.
-
/var/log/nginx/: Contains logs for the Nginx web server, including access and error logs.
-
/var/log/mysql/: Contains logs for MySQL database server activities.
-
/var/log/boot.log: Records boot-related messages and events.
These log files are essential for monitoring system performance, troubleshooting issues, and maintaining security in a Linux environment.
