AfterLogin method

I’m trying to log with apache.log4j when the user was last logged in. I try configure security for my own AuthenticationSuccessHandler method but spring is ignoring it.
Vaadin 23
My current configuration of SecurityConfig:

@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers(“/images/**”)
.permitAll();
super.configure(http);
setLoginView(http, LoginView.class);
}

which i changed but adding after .permitAll()
and().formLogin()
.loginPage(“/login”)
.successHandler(new MySuccessHandler()) // Activate the SuccessHandler

and here is MySuccessHandler:
public class MySuccessHandler implements AuthenticationSuccessHandler {

@Override
public void onAuthenticationSuccess(HttpServletRequest request,
        HttpServletResponse response, Authentication authentication)
        throws IOException, ServletException {
    
    // Add a debug message to the console
    System.out.println("SuccessHandler activated. User has been authenticated.");

AfterLogin method

You have to access the FormLoginConfigurer after you’ve called setLoginView, otherwise it’s overwritten.

Thank You!