Hi all,

A quick verification that
using IRequestCycleListener#onRequestHandlerResolved() to add the page
class to the logging context is the way to go.

Sample code:

public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler
handler) {
    if (handler instanceof RenderPageRequestHandler rprh) {
         String page = rprh.getPageClass().getSimpleName();
         [add to logging context]
    } else if (handler instanceof ListenerRequestHandler lrh) {
         Component c = (Component) lrh.getComponent();
         Page pg = c.getPage();
          String page = pg.getPageClass().getSimpleName();
          [add to logging context]
    }
}

Thank you in advance!
Marios

Reply via email to