gpt4 book ai didi

spring-boot - Spring boot 禁用 Http11InputBuffer 日志记录

转载 作者:行者123 更新时间:2023-11-28 22:47:06 25 4
gpt4 key购买 nike

我想阻止我的应用程序记录所有 http 请求的主体。所以我创建了一个组件

CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter();
filter.setIncludeQueryString(false);
filter.setIncludePayload(false);

但是设置

logging.level.root=DEBUG

我的 application.properties 似乎 Http11InputBuffer 仍然记录我的请求正文。有办法避免这种情况吗?

最佳答案

我不确定 CommonsRequestLoggingFilter 是否执行了您想阻止的日志记录。无论如何,您可以像这样为特定的包或类设置日志记录级别,或完全禁用日志记录:

application.yml

logging:
config: classpath:logback-spring.xml
level:
root: DEBUG
org.apache.coyote.http11.Http11InputBuffer: OFF

关于spring-boot - Spring boot 禁用 Http11InputBuffer 日志记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55588767/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com