Monday, December 14, 2009

Linux Logs

Discover the basics of viewing/searching through common Linux log files on command line as well as through a GUI and discover one of the coolest visualizations for apache log files.

A common way to watch log files is to use the -f flag and tail. Most log files are protected so you will need elevated privileges to view them.

Common Log Files

  • auth.log – Authentication info
  • boot.log – Boot info
  • crond – Scheduled cron tasks
  • daemon.log – Daemon specific alerts like, dhcpd, gnome-session, ntfs-3g
  • dmesg – Kernel specific messages
  • errors.log – As you may have guess this logs errors
  • everything.log – A misc. catch all log
  • httpd – Apache access and error logs
  • mail.log – Mail server logs
  • messages.log – General system alerts
  • mysqld.log – MySQL database log
  • secure – Security log
  • syslog.log – A log for the log system
  • vsftpd.log – A log for the FTP server, vsftpd
  • Xorg.0.log – X log

You will probably quickly notice that there are a lot of duplicate looking files in /var/log with numbers at the end of them. Some of them might even have .gz at the end. These are called rotated logs. Usually the log rotator ‘logrotate‘ is responsible for rotating old logs at a specified interval in ‘/etc/logrotate.conf‘. For more information about logroate do, ‘man logrotate

Viewing Logs in GUI

To view log files in Gnome go to: Applications > System Tools > Log File Viewer


No comments:

Post a Comment