On Sun, Nov 20, 2011 at 8:59 PM, James <james.eliye...@gmail.com> wrote:

> Dear wicket community,
>
> In a project that I'm working on, I need to build a "live log viewer" or
> "dynamic log viewer" or "refreshable log viewer".
> Much like how hudson/jenkins displays the console output.
>
> The idea is to dynamically display the new data added to a log file along
> with the existing content.
>
> How to go about doing this? Please throw some light on this.
>
> I searched about this in the web, mailing lists but couldn't find what I
> was looking for, so I'm posting it here.
> If this is asked elsewhere, kindly re-direct me to the respective resource.
>

I suppose you're only asking about the web UI portion of this application.
 The service / backend stuff is out of the context of this forum.
 (Although I would suggest looking at using something like Camel that has
all the necessary stuff for monitoring files and file streams and then
routing messages through to your application and/or other processors - see
[1] below).

For the web UI part, there are basically two methods: push, poll

1 - push - using something like cometd, etc to do AJAX push events (really,
these are long-pollers, leaving long-running HTTP requests going and
processing a stream of events that are received over the life of the
connection)

2 - poll - if you have some component that shows the last X lines of a log
file, just call component.add(new AjaxSelfUpdatingTimer(someDuration)).  As
long as you've written your IModel correctly (it always retrieves the most
up-to-date data), this will work "out of the box"

[1] http://camel.apache.org/stream.html - and things like scanStream

-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*

Reply via email to