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
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.