We're trying to switch Jetty request logging to logback access to get 
better control of options, especially compression on file rotation.

The instructions are here <http://logback.qos.ch/access.html#jetty>:  

Basically have to make sure that jetty.xml includes *RequestLogHandler* and 
then add a reference to it pointing to 
ch.qos.logback.access.jetty.RequestLogImpl 

Now in the pax web documentation I would like to use the service 
registration approach as described here. 
<http://ops4j.github.io/pax/web/6.x/User-Guide.html#adding-specialized-contexthandlers>

I created a small component with:
    @Activate
    private void activate(BundleContext context) {
        log.trace("Activating {}", getClass()); //$NON-NLS-1$
        RequestLogHandler requestLogHandler = new RequestLogHandler();
        context.registerService(Handler.class, requestLogHandler, null);
        RequestLogImpl requestLogImpl = new RequestLogImpl();
        Optional.ofNullable(irisConfig)
                .map(config -> 
config.getValue(ConfigConstants.NCSA_LOG_CONFIG))
                .ifPresentOrElse(requestLogImpl::setFileName,
                        () -> log.error("No configured NCSA request log 
file location")); //$NON-NLS-1$

        context.registerService(RequestLog.class, requestLogImpl, null);
    }

The code is invoked correctly but I put a breakpoint in 
RequestLogImpl#getConfigurationFileURL but it is never called. Looking at 
my log I have the feeling that paxweb is starting before my code runs.

So am I doing something wrong in registering the services or is it an issue 
of ordering or something else?

Any help will be greatly appreciated.

Cheers
Alain

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/cafa4d6c-5eda-49e5-a72f-d17e1bd256edn%40googlegroups.com.

Reply via email to