Improve Web DEBUG logging output configuration

Since SPR-16946, Spring Framework revisited the DEBUG logging output
developers get while working on Spring MVC and Spring WebFlux
applications.

This commit aligns to those changes where DEBUG output was produced
in Spring Boot (especially in `DefaultErrorWebExceptionHandler`).

This also enables DEBUG logging on the related packages when running an
application with Spring Boot Developer Tools, providing a better
development experience.

This is also adding the new `spring.insights.web.log-request-details`
configuration property, which logs additional information about the
incoming requests at the DEBUG and TRACE levels. Since that information
can be sensitive (e.g. credentials, tokens, etc.), this property is not
enabled by default nor activated by the Developer Tools.

Closes: gh-13511
This commit is contained in:
Brian Clozel
2018-08-16 17:34:42 +02:00
parent 13f08e4c89
commit f2511b7fa3
9 changed files with 107 additions and 50 deletions

View File

@@ -59,6 +59,9 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
devToolsProperties.put("server.error.include-stacktrace", "ALWAYS");
devToolsProperties.put("server.servlet.jsp.init-parameters.development", "true");
devToolsProperties.put("spring.reactor.stacktrace-mode.enabled", "true");
devToolsProperties.put("logging.level.org.springframework.web", "DEBUG");
devToolsProperties.put("logging.level.org.springframework.core.codec", "DEBUG");
devToolsProperties.put("logging.level.org.springframework.http", "DEBUG");
PROPERTIES = Collections.unmodifiableMap(devToolsProperties);
}