views:

524

answers:

2

Hi all,

In my Java servlet code, I want to be able to programatically write to the jetty access log. I am aware that jetty will automatically log every incoming HTTP request to the access log. However, my servlet needs to occasionally append it's own line to the access log. Has anyone here done something similar?

Thanks!

A: 

Subclass and configure: http://docs.codehaus.org/display/JETTY/Logging+Requests

Lispnik
A: 

I think Lispnik is on the right track. You want to get a handle on the NCSARequestLog described in http://docs.codehaus.org/display/JETTY/Logging+Requests and send log messages directly to it, by calling log(). So you want to find the place in your code that's currently configuring the NCSARequestLog and substitute a modified version of the code that will return the pointer to the log it created.

PanCrit