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:

protected void configure(HttpSecurity http) throws Exception {
setLoginView(http, LoginView.class);

which i changed but adding after .permitAll()
.successHandler(new MySuccessHandler()) // Activate the SuccessHandler

and here is MySuccessHandler:
public class MySuccessHandler implements AuthenticationSuccessHandler {

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!