Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
Description
The use of HttpServletResponse.getStatus is not reliable for a request logging library.
The status code is not immutable on the servlet spec and is often reset or change from when the status code was committed (sent over the network) vs when it reaches the request logging implementation in `logback-access`.
Libraries like spring-framework, spring-mvc, spring-boot, spring-security, all change the status code on the way out of the context dispatch.
Every decent servlet container tracks the "committed state" of the Request and Response objects and use those values for their own request logging implementation just to ensure that their request logging contains accurate (as seen on the network) information in the request log.
Example:
Jetty has `response.getCommittedMetaData().getStatus()` for the status code.
Attachments
Issue Links
- links to