如何在Spring Boot中设置enableLoggingRequestDetails ='true'

Adi*_*ens 10 logging spring spring-boot

我今天尝试调试我的应用程序,但是spring boot控制台显示以下消息:

enableLoggingRequestDetails ='false':请求参数和标头将被屏蔽,以防止不安全地记录潜在的敏感数据

同时,我想知道应用程序中正在发生的一切。

所以我的问题是:如何在中启用日志记录请求详细信息application.properties

Doc*_*ter 11

使用 webflux 和 spring boot 2.3.0 时,可以设置以下属性来记录请求详细信息。

logging.level.org.springframework.web.server.adapter.HttpWebHandlerAdapter=DEBUG
spring.codec.log-request-details=true
Run Code Online (Sandbox Code Playgroud)


Ari*_*ion 10

logging.level.org.springframework.web=DEBUG
spring.http.log-request-details=true
Run Code Online (Sandbox Code Playgroud)

在你的application.properties,如果你想看到loggingRequestDetails。

  • 属性 `spring.http.log-request-details` 已弃用:使用 `spring.mvc.log-request-details` 代替。 (2认同)