Skip to content

Improve Servlet and Filter registration logging #15166

@bclozel

Description

@bclozel

This issue is related to #13511 and #14292 - about improving the logging experience in Spring Boot.

In comment on SPR-17450, someone mentioned that the Servlet Filter registration logs are not consistent with what we've done so far:

INFO 14944 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
INFO 14944 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
INFO 14944 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'formContentFilter' to: [/*]
INFO 14944 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
INFO 14944 --- [           main] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]

@rstoyanchev indeed suggests to reconsider the logging level and could log everything on a single line with a map-like structure:

CharacterEncodingFilter [/*], HiddenHttpMethodFilter [/*], FormContentFilter [/*], ...

Currently we're logging that information:

  • at INFO level in AbstractFilterRegistrationBean.configure for embedded and WAR deployments
  • at DEBUG level in ServletContextInitializerBeans for embedded deployments only

I think we should remove all the above logging information and replace it with one-liners in ServletContextInitializerBeans at DEBUG level, and add that class to the web logging group.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions