Front End Logging (tail -f stuff)

Entering a new coding environment (working in a national company), I’ve got several things learned.

One of the important is that I have to take care of every logging activities. It means that people needs me to write any transaction (success, fail, or error) to a flat file.

After my application’s been launching live, the “operation people” can check the log file for any transaction activities using unix command :

tail -f <log_file>


Rather than supply them with backend checking, I’d prefer to make it (checking log file) into frontend using php.

Here’s the code I scratch to “tail” the log file in FrontEnd :

<script language="javascript">
setInterval ( "window.scrollBy(0,100)", 5 );
<a href="http://localhost/tesapps">Click</a>
$page = $_GET[log]; //supply this GET variable with path to log file
system("tail -f $page");
echo "<h1>Please provide log file to read !</h1>";

With this code, I can simulate tail activities in web browser

nice, huh? đŸ™‚


Tags: , , , ,

About sisusilo

I was born after we celebrate youngman promise about their commitment to this country

2 responses to “Front End Logging (tail -f stuff)”

  1. anggriawan says :

    scriptnya gak aman tuh..

  2. antonrifco says :

    hooh pak
    tapi dibuat supaya bisa diakses dari IP tertentu doang

    *shortcut doang sih, haha

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: