首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >DEBUG - ConfigurationUtils.locate():base为空

DEBUG - ConfigurationUtils.locate():base为空
EN

Stack Overflow用户
提问于 2013-04-04 14:32:22
回答 1查看 3.9K关注 0票数 1

我正在使用apache通用PropertiesConfiguration加载属性文件,目前我使用的内容如下所示

代码语言:javascript
代码运行次数:0
运行
复制
public class PropertiesConfig {
private Configuration config;
private Logs logger = new Logs();

public PropertiesConfig(){
    try {
        config = new PropertiesConfiguration(Constant.PROP_FILE_PATH+Constant.PROP_FILE_NAME);
    } catch (ConfigurationException e) {
        logger.error(e.getMessage(), e);
    }
    logger.info("Properties File Loaded : "+Constant.PROP_FILE_PATH+Constant.PROP_FILE_NAME);
    }
 public String[] getPropertiesByArray(String key){
    return config.getStringArray(key);
}
}

这就是我在控制器类中加载它的方式

代码语言:javascript
代码运行次数:0
运行
复制
 public void loadConfig(){
    this.dir = config.getPropertiesByArray(Constant.PROP_DIR_CONFIG);
    logger.info("Loading Dir path list from propeties config");
    for(String d : dir){
        logger.info("Dir Set: "+d);
}

但是在我的控制台中,我有这个debug msg

代码语言:javascript
代码运行次数:0
运行
复制
2013-04-04 14:14:18,657
DEBUG - ConfigurationUtils.locate(): base is null, name is conf/configuration.properties

2013-04-04 14:14:18,672
DEBUG - Loading configuration from the path conf\configuration.properties

2013-04-04 14:14:18,688
INFO  - Properties File Loaded : conf/configuration.properties

它正在加载我属性文件,但我不确定如何摆脱调试消息

EN

回答 1

Stack Overflow用户

发布于 2013-05-08 23:58:41

前两条消息只是调试消息。您的记录器必须配置为显示它们。

您必须配置您的记录器来过滤org.apache.commons.configuration.ConfigurationUtils消息作为信息(或更高)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15804055

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档