Linux View / display a logfile in real time on screen

by Vivek Gite on October 2, 2007 · 2 comments

Q. I'd like to see my php or apache web server log files in real time. How do I see log file in real time including all incoming logs?

A. You need to use tail command which output the last part of files in real time including all incoming logs to a file.

tail -f file-name command

If your log file name is /var/log/lighttpd/access.log, enter:
tail -f /var/log/lighttpd/access.log

If your php log file name is /var/log/lighttpd/scripts.log, enter
tail -f /var/log/lighttpd/scripts.log

You will get a scrolling view of the /var/log/lighttpd/scripts.log for all incoming entries on screen. To stop simply hit CTRL+C. Please note that you may need to login as root user to view log files.

Updated for accuracy.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 2 comments… read them below or add one }

1 Rogha December 15, 2009

how do to view this tail -f log.log on a web?

Reply

2 Romero May 7, 2011

not that simple, u must use ajax.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 9 + 3 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: