Or should I have two components?
One to display the existing content of the log and the other one to display
the dynamically added new content..?

On Mon, Nov 21, 2011 at 11:07 AM, James <james.eliye...@gmail.com> wrote:

> Jeremy,
>
> Thanks for your suggestions.
>
>
> *>> I suppose you're only asking about the web UI portion of this
> application.*
>
> Yes, I was asking about the web ui portion only.
>
>
> *>> For the web UI part, there are basically two methods: push, poll*
>
> I would like to use the "poll" method. In fact, I'm trying exactly with
> the AjaxSelfUpdatingTimer behavior only.
> The problem is I don't want to display just the last x lines of the log
> but instead show the "current" content of the log while adding new content
> at the bottom.
> Something like "tail -F foo.log".
> I agree that if I were to display the last x lines, a
> LoadableDetachableModel implementation with the appropriate logic alone
> would be sufficient.
>
>
> On Mon, Nov 21, 2011 at 10:51 AM, Jeremy Thomerson <
> jer...@wickettraining.com> wrote:
>
>> 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*
>>
>
>
>
> --
> Thanks & Regards,
> James
>



-- 
Thanks & Regards,
James

Reply via email to