Expand my Community achievements bar.

How to tail the app server log file and send to flash client

Avatar

Former Community Member

I'd like a mechanism where the LCDS detects any changes in the App Server log file and sends them to the Flash client for display. Is there a practical one...?

thanks

RK

1 Reply

Avatar

Employee

Hi RK,

It should be pretty easy to implement this. There are a couple features in LCDS that should make setting this up fairly straightforwad. LCDS has the notion of a bootstrap service that is started when the server starts up. LCDS also has the ability to do server push; ie push messages from the server to a destination that a client application is subscribed to. You could write a bootstrap service that tails your app server log file and then pushes any changes to a messaging destination that the Flash client is subscribed to.

There is some LCDS sample code you can look at that will show you how to both setup a bootstrap service and do server push. In the WEB-INF/src directory of the

lcds-samples webapp take a look at the flex.samples.feed.Feed class. This class uses the MessageBroker.routeMessageToService API to push messages to a destination. Also look at the flex.samples.runtimeconfig.EmployeeRuntimeDataDestination class. This is an example of a bootstrap service that is created and started at server startup.

For the log file tailing, it looks like there are a number of libraries written in Java to do this. This thread mentions some of them.

http://stackoverflow.com/questions/557844/java-io-implementation-of-unix-linux-tail-f

Hope that helps.

-Alex