avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Steuck <greg-avalon-...@nest.cx>
Subject Sevak Jetty request logging (access_log)
Date Sat, 01 Feb 2003 18:16:00 GMT
Hello,

I'm running Sevak/Jetty and I would like to log processed requests.
There seems to exist 2 ways to do that: use Jetty's native request
logging or implement logging at the Avalon container layer. I feel it's
beneficial to have all logging controlled in one place: the container.

Fortunately Jetty is very flexible, so what we can do is implement
interface org.mortbay.http.RequestLog and then pass this implementation
to setRequestLog of org.mortbay.jetty.Server that JettySevak builds.
Jetty already comes with NCSARequestLog implementing RequestLog. In my
opinion it is a bit too specialized for Jetty use to be reused for our
purposes.

We can enable Avalon space logging in Sevak Jetty by performing the
following steps:

* declare o.a.a.a.sevak.blocks.jetty.RequestLogger role
  with a sole method
   void log(HttpRequest request, HttpResponse response, int responseLength)
* make o.a.a.a.sevak.blocks.jetty.JettySevak dependent on
  RequestLogger service
* setRequestLog for Server in JettySevak.initialize() using a simple
  adapter from RequestLogger to org.mortbay.http.RequestLog. That
  adapter will provide empty implementations of
  org.mortbay.util.LifeCycle methods (they are not needed for our
  component that has its lifecycle managed in Avalon container)
* create NullRequestLogger with empty implementation of log()
* create NCSARequestLogger that logs request information in NCSA
  (== apache httpd) format, to do that a portion of NCSARequestLog.log
  code from Jetty can be copied (provided Mort Bay Consulting doesn't mind
  our relicensing some 45 lines under Apache license)

Thoughts?

Thanks
Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message