-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Allow logging REST endpoint mappings independent of other log categories #26539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This has been discussed before. The number of endpoints can vary a lot. For a few controllers it is not an issue but for most applications tens or hundreds of endpoints is too much and floods log output. If necessary to show for debugging, mappings can be enabled at TRACE, as you have done, but otherwise they don't need to shown on every startup. At runtime you can also use Boot's actuator to check mappings. That aside we can create a log category that can be used to control the logging of handler mappings only. |
I see, thanks for the explanation, @rstoyanchev! |
Thanks @rstoyanchev ! |
@rstoyanchev This seems to have changed the logging level for Router functions: |
Affects: Spring Web MVC 5.3.3
After upgrading from Spring4 to Spring5.3 we face a problem: there is no easy way to log just mappings of Controllers to endpoints.
The expected scenario: during booting a Spring MVC web application we would like to have all endpoint mappings in logs. However we don't want all request processing by Spring MVC to be logged because it would generate enormous amount of logs in production.
Currently, if we enable TRACE log level for
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
we receive both needed logs during boot of the webapp but also all requests processed are logged
RequestMappingHandlerMapping - Mapped to ...
).Please provide a way to just log the endpoint mappings.
The issue was discussed in SO: https://stackoverflow.com/questions/40621044/log-restful-endpoints-on-container-startup-in-a-spring-application
The text was updated successfully, but these errors were encountered: