带有 Spring 的 Jasypt ... 记录器配置

Jasypt with Spring ... Logger Config

在 Spring 中使用 Jasypt 时,PropertiesLoaderSupport class 的加载属性方法中的记录器级别设置为 Info

protected void loadProperties(Properties props) throws IOException {
        if (this.locations != null) {
            for (Resource location : this.locations) {
                if (logger.isInfoEnabled()) {
                    logger.info("Loading properties file from " + location);
                }

上面的代码块 return 在使用 Jasypt 时是正确的,而它 return 在 Spring 中是错误的,因为我收到了很多不需要的日志消息。

有人可以建议我如何通过配置将其设置为 return false 。

我也在为我的应用程序使用 log4j。

谢谢

经过大量搜索,我找到了结果...要解决此问题,我们必须在用于应用程序的记录器配置中设置 Jasypt 的记录器属性。例如

名称="log4j.logger.org.jasypt">错误

这将解决问题。