[Jetty-support] Request Log per Virtual Host

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jetty-support] Request Log per Virtual Host

Karl Ostendorf
Is it possible to set one request log per virtual host / context?

With the following I am able to define a request log, but it is global for all contexts.  Any help would be appreciated.

  <Ref id="requestLog">
    <Set name="requestLog">
      <New id="requestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
        <Arg><SystemProperty name="jetty.home" default="." />/logs/yyyy-mm-dd.log</Arg>
        <Set name="retainDays">90</Set>
        <Set name="append">true</Set>
        <Set name="extended">true</Set>
        <Set name="LogTimeZone">CET</Set>
      </New>
    </Set>
  </Ref>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support
Reply | Threaded
Open this post in threaded view
|

Re: [Jetty-support] Request Log per Virtual Host

Tim Vernum

On 07/11/2006, at 3:58 AM, Karl Ostendorf wrote:

> Is it possible to set one request log per virtual host / context?
>
> With the following I am able to define a request log, but it is  
> global for all contexts.  Any help would be appreciated.
>
>   <Ref id="requestLog">
>     <Set name="requestLog">
>       <New id="requestLogImpl"  
> class="org.mortbay.jetty.NCSARequestLog">
>         <Arg><SystemProperty name="jetty.home" default="." />/logs/
> yyyy-mm-dd.log</Arg>
>         <Set name="retainDays">90</Set>
>         <Set name="append">true</Set>
>         <Set name="extended">true</Set>
>         <Set name="LogTimeZone">CET</Set>
>       </New>
>     </Set>
>   </Ref>

There are 2 options I can see.
(a) write your own RequestLog implementation. You can probably do  
some relatively minor tweaks to NCSAReqLog to do that.

(b) Rework your handler stack a bit to have 2 separate request log  
handlers, each with their own req-log implementation.
       You might need to tweak the request log handler a little, but  
I suspect not.

I'd probably go with (b) because it suits my design tastes a little  
better - it relies on Jetty to make the decision about which context  
the request belonged to, rather than having the log impl duplicate  
that logic. But both seem like reasonable choices.

Have a go with one of those and then post back to tell us how it  
went. (And ask for more help if required)



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jetty-support mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-support