Log access screen

I want to log when users visit screens, how do I do that? I can’t edit all the screens I already have, like that:

image

Regards,
HungTM

Hi

You can add something like this to your MainView controller:

    @Override
    public void afterNavigation(AfterNavigationEvent event) {
        super.afterNavigation(event);

        log.info(UI.getCurrent().getCurrentView().getId().orElse("null"));
    }

Best regards,
Dmitriy

1 Like