We are using Custom Filter to do our authentication.
Our Custom Filter extends from BasicAuthenticationFilter. We are using only Basic Authentication In our application. We did it like that, because we wanted to handle different authentication scenarios in our authentication entry point.
Whenever an API is invoked our Filter kicks in, which is causing lot of logs to be printed on console. These logs are itself coming from the BasicAuthenticationFilter.class (Which our Filter has extended)
if (this.authenticationIsRequired(username)) { UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(username, tokens[1]); authRequest.setDetails(this.authenticationDetailsSource.buildDetails(request)); Authentication authResult = this.authenticationManager.authenticate(authRequest); if (debug) { this.logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); this.rememberMeServices.loginSuccess(request, response, authResult); this.onSuccessfulAuthentication(request, response, authResult); } Is it possible to avoid this logging, without having to actually override the function.