Watching Linux logs live

posted: Thursday 17 December 2009 by Tavis J. Hampton in: VPS & Dedicated Web servers Software

Mario and Luigi checking Linux logs

Question: How can I watch information come into my Linux server logs as they arrive?

Answer: Linux has a nifty little command called “tail” that allows you to see the latest log file messages, but that by itself will not show you the latest messages as they arrive in real time. For that, all you have to do is add the “-f” tag to the end of the tail command. For example, if you want to watch mail server messages as they arrive, enter as root:

tail -f /var/log/maillog

Similarly, for Apache web server access logs, you would enter something like:

tail -f /var/log/httpd/access

And for web server errors:

tail -f /var/log/httpd/errors

Generally speaking, it will occupy your command prompt, not allowing you to do anything else. If you want to keep working and do not mind being interrupted whenever a message comes in, you can add the &, and it will return you to the command line.

tail -f /var/log/maillog &

Photo Source: Flickr

1 stelle2 stelle3 stelle4 stelle5 stelle (no votes)
share this 0 comments

Related posts

Server OS Tips del 30 Jul 2010
Server Backup Tips del 30 Jul 2010
Server Hardware Tips del 28 Jul 2010
Server Maintenance Tips del 28 Jul 2010

Related tags

Be the first to add a comment to this article.

Your email address is required but won't be displayed.
Leave a comment

Register to reserve your nickname accross all the blogs in the Blogo network and to upload your avatar. If you already are registered, login to user your nickname.

Yes No

Comment preview

Network Blogo