jQuery log viewer

Released 3 years ago , Last update 3 years ago

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.

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">
3.4
  • 5 3
  • 4 0
  • 3 0
  • 2 0
  • 1 2
5 Reviews Read Reviews

Pricing

FREE

Personal License

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Commercial use

License » Personal License Download

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
  • DK Dusan Knezevic 6 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.