jQuery log viewer

Shows file contents in a web browser and updates it in real-time without fetching the entire contents each time. Very useful for watching live logs or building chat engines from flat files.

  • Language: JavaScript
  • Released: Sep 17, 2011
    Last Update: Sep 17, 2011

Log viewer is a jQuery plugin that shows file contents in a web browser. File contents are fetched from the last changed position, so it can be used to stream large amount of changes without having to fetch large amounts of data each time.

Log viewer needs a real web server to operate. It uses AJAX to get updated file contents with a positioned HEAD request that gets the file size and fetches only the bytes added since the last change to the file.

LogViewer comes with an instruction page - index.html.

To run logViewer you need to include jQuery library first, then the logViewer plugin in <script> tags.

Log viewer options: - logUrl - web location of desired log file - refreshtimeout - refresh interval in ms - readBytes - initional amount of bytes to fetch - callback - user function to call to modify new content if necessary before it is appended to log window. The callback receives new content as a single argument and must return it.

Example usage

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="jquery.logviewer.js"></script>
<script type="text/javascript">

jQuery(document).bind("ready", function() {
     jQuery('#logcontent').logViewer({logUrl: 'log.html'});
});
</script>
</head>
<body>
Live log:<br/>
<textarea id="logcontent" autocomplete="off">
You need to log-in or create an account
  • Create an account
  • Log-in
Please use your real name.
Activation link will be sent to this address.
Minimum 8 characters
Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

or Get a quote

for customization or integration services

  • good
    L luca
    3 years ago, 0 comments
    Was this helpful?
    Flag 1 of 1 people found this review helpful
  • Works as expected. File delivered as a zip file but was intact rar which caused some unnecessary difficulties.
    RS Roland Sambain
    2 years ago, 0 comments
    Was this helpful?
    Flag
  • Very nice little script. Works flawlessly on every browser Ive tested. THANKS!
    R RusTus
    3 years ago, 0 comments
    Was this helpful?
    Flag
Post a comment

Or enter your name and Email
  • DK Dusan Knezevic 3 months ago
    Not as good i I expected
  • F firstlevel 1 year ago
    it does not work properly if the response is gzipped. There is no way to modify Accepted-Encoding header in ajax request
  • H Harry 2 years ago
    Hi, I am streaming using your tool, the file is from a remote server, but the streamer seems to keep duplicating the log file over and over, make the page unresponsive.