Log Files In Linux




There is a friend of mine asked how we can look at the log files in Ubuntu Linux?

Well, for those who do not yet know what the log files I described a little never hurts not?

The log file is a file that stores all the OS behavior, ranging from the system, application, user and others. The log file records every command that is executed by the user, the ip address to access the web (if the webserver), incoming and outgoing email (if your mailserver) etc.

By default the log file is located in the folder "/var/log/" – otherwise wrong > all linux distros are also same



Here are some log files and their uses:
/var/log/messages = General log messages
/var/log/boot = System boot log
/var/log/debug = Debugging log messages
/var/log/auth.log = User login and authentication logs
/var/log/daemon.log = Running services such as squid, ntpd and others log message to this file
/var/log/dmesg = Linux kernel ring buffer log
/var/log/dpkg.log = All binary package log includes package installation and other information
/var/log/faillog = User failed login log file
/var/log/kern.log = Kernel log file
/var/log/lpr.log = Printer log file
/var/log/mail.* = All mail server message log files
/var/log/mysql.* = MySQL server log file
/var/log/user.log = All userlevel logs
/var/log/xorg.0.log = X.org log file
/var/log/apache2/* = Apache web server log files directory
/var/log/lighttpd/* = Lighttpd web server log files directory
/var/log/fsck/* = fsck command log
/var/log/apport.log = Application crash report / log file
To view the log files above, we could use some Linux commands, including:

Tail (see the latest log/bottom on the list).
tail -f /var/log/file.log

More (see log more fully).
more /var/log/file.log

Paint (see the log with a standard view) –> the most commonly used.
cat /var/log/file.err

Less (see logs per page/a lull divided per screen) –> this I like
less /var/log/file.log

Grep (see the log by giving the desired word filter), the example below is view log containing the word "fail".
grep -i fail /var/log/file.log

To use the GUI (KDM or GDM) can see the log by going to:
System = > Administration = > Log File Viewer

Or just type (Gnome-specific):
gnome-system-log &


Next
Previous
Click here for Comments

0 comments: