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:
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.
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