Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
Free

Personal License

1 site, unlimited servers No source distribution
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

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

  • Released: Sep 17, 2011
    Last Update: Sep 17, 2011
  • Language: JavaScript
(5 ratings)

jQuery log viewer

jQuery log viewer
Developed by George Sarafov, Released Sep 17, 2011

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.

JavaScript

Tags: jquery ajax log viewer

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">
View all 5 reviews »

User Reviews

  • Roland Sambain 1 year ago
    Works as expected. File delivered as a zip file but was intact rar which caused some unnecessary difficulties.
    Flag
    Was this helpful? Yes No
  • RusTus 1 year ago
    Very nice little script. Works flawlessly on every browser Ive tested. THANKS!
    Flag
    Was this helpful? Yes No
  • 1 of 1 people found this review helpful luca 2 years ago
    good
    Flag
    Was this helpful? Yes No
Read all 3 comments »

Questions & Comments


Or enter your name and Email
  • Harry 9 months 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.
  • Onder Vincent Koc 1 year ago
    Its not refreshing on my test,... code is quite simple and nice, the log file loads great but will not update, do i need to set the timer?... if so why wasnt this in the example.

    Thanks,
    Vincent
    • George Sarafov Developer 1 year ago
      You don't need to set up timer manually, default refresh value is 2000 ms and can be defined with 'refreshtimeout' option. May be you are facing some browser related issue.
You must be logged-in to vote. Log-in to your account or register now.