RequestLogHandler must be executed before any tracking context.
The ideal way to use RequestLog is to install it on the server, rather than using RequestLogHandler ...
jettyServer.setRequestLog(requestLog);
But if you need to use it as a handler, then you need to make sure that it is executed before any contexts that you want to track ...
HandlerList topLevelHandlers = new HandlerList(); topLevelHandlers.addHandler(requestLogHandler); topLevelHandlers.addHandler(context); jettyServer.setHandler(topLevelHandlers);
or wrap the context with a query log handler ...
requestLogHandler.setHandler(context); jettyServer.setHandler(requestLogHandler);
source share