gpt4 book ai didi

java - org.springframework.core.env.PropertySourcesPropertyResolver 在 Debug模式下打印值

转载 作者:搜寻专家 更新时间:2023-11-01 03:52:02 27 4
gpt4 key购买 nike

我正在使用属性占位符读取 jdbc.properties 文件,如下所示。

<context:property-placeholder location="classpath*:jdbc.properties" />

在属性文件中,我存储了 jdbc 配置和密码。当我在 Debug模式下运行 springframework 时。它正在打印属性值,即密码。有解决办法吗?这是我的日志语句。

2014-05-20 18:37:32,076 [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Could not find key 'database.password' in any property source. Returning [null]
2014-05-20 18:37:32,076 [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Searching for key 'database.password' in [localProperties]
2014-05-20 18:37:32,076 [main] DEBUG o.s.c.e.PropertySourcesPropertyResolver - Found key 'database.password' in [localProperties] with type [String] and value 'pass'
2014-05-20 18:37:32,076 [main] TRACE o.s.util.PropertyPlaceholderHelper - Resolved placeholder 'database.password'

最佳答案

这是一篇旧文章,我不确定您是否只是想有选择地从日志中删除它们,但为了简单的回答,我在 application.properties 中使用了以下内容。

logging.level.root=error
logging.level.com.springcloudexample=trace

第二行是应用根命名空间。

关于java - org.springframework.core.env.PropertySourcesPropertyResolver 在 Debug模式下打印值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23761089/

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