Hi, we have been trying to make request log work in servicemix using
different approaches.
In first place, we tried to use ops4j configuration in the
etc/org.ops4j.pax.web.cfg file as follow based on [1] but it didn't work.

org.ops4j.pax.web.log.ncsa.format=/tmp/yyyy_mm_dd.request.log
org.ops4j.pax.web.log.ncsa.retaindays=10
org.ops4j.pax.web.log.ncsa.append=true
org.ops4j.pax.web.log.ncsa.extended=true
org.ops4j.pax.web.log.ncsa.timezone=GMT

Next we tried to set up a custom jetty.xml file where we added a request
log handler. In this approach, we configured etc/org.ops4j.pax.web.cfg file
as follow:

org.ops4j.pax.web.config.file=etc/jetty.xml

and we modified the jetty.xml file as depicted next:

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//
DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd";>

<Configure class="org.eclipse.jetty.server.Server">

    <Call name="addConnector">
        <Arg>
            <New
class="org.eclipse.jetty.server.nio.SelectChannelConnector">
                <Set name="host">
                    <Property name="jetty.host"/>
                </Set>
                <!-- default port will be overwritten by pax-web
configuration -->
                <Set name="port">
                    <Property name="jetty.port" default="8182"/>
                </Set>
                <Set name="maxIdleTime">300000</Set>
                <Set name="Acceptors">2</Set>
                <Set name="statsOn">false</Set>
                <Set name="confidentialPort">8443</Set>
                <Set name="lowResourcesConnections">20000</Set>
                <Set name="lowResourcesMaxIdleTime">5000</Set>
            </New>
        </Arg>
    </Call>

 <Call name="getHandler">
        <Set name="handlers">
            <Array type="org.eclipse.jetty.server.Handler">
                <Item>
                    <New
class="org.eclipse.jetty.server.handler.StatisticsHandler">
                        <Set name="handler">
                            <New
class="org.eclipse.jetty.server.handler.HandlerCollection">
                                <Set name="handlers">
                                    <Array
type="org.eclipse.jetty.server.Handler">
                                        <Item>
                                            <New
class="org.eclipse.jetty.server.handler.ContextHandlerCollection" />
                                        </Item>
                                        <Item>
                                            <New
class="org.eclipse.jetty.server.handler.DefaultHandler" />
                                        </Item>
                                        <Item>
    <New class="org.eclipse.jetty.server.handler.RequestLogHandler">
                                                <Set name="requestLog">
                                                            <New
id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
  <Arg>/tmp/yyyy_mm_dd.request.log</Arg>
  <Set name="retainDays">90</Set>
  <Set name="append">true</Set>
  <Set name="extended">false</Set>
  <Set name="LogTimeZone">GMT</Set>
 </New>
                                                </Set>
                                            </New>

 </Item>
                                    </Array>
                                </Set>
                            </New>
                        </Set>
                    </New>
                </Item>
            </Array>
        </Set>
    </Call>

</Configure>

Couriously, this last approach works on Jboss Fuse version as expected.

What is wrong in both approaches? what is the best way to add a http
request listener that produces logs in NCSA format?



[1] https://ops4j1.jira.com/wiki/display/paxweb/Basic+Configuration

-- 
Mario Matias Urbieta
[email protected]
www.fluxit.com.ar Calle 9 #865
La Plata / Buenos Aires / Argentina
Tel: +54 221 4275781 Int:308
Cel: +54 011 36814113
-- 
Mario Matias Urbieta
[email protected]
www.fluxit.com.ar Calle 9 #865
La Plata / Buenos Aires / Argentina
Tel: +54 221 4275781 Int:308
Cel: +54 011 36814113

Reply via email to