Closed maodeng8888 closed 6 years ago
你好,感谢反馈!
问题1、“yml” 方式配置,在解决问题2时将一并解决,可以参考问题2的回复。
问题2、我们正在寻找办法,将配置文件 “xxl-conf.propertie” 迁移至 “application.properties”,但是失败了,如果您有好的方法,欢迎一起讨论,非常期待!
失败原因是因为 “XxlConfFactory” 继承 “BeanDefinitionRegistryPostProcessor” ,它初始化时间非常早,优先于 “application.properties” 中配置初始化,所以无法获取 “application.properties” 中的配置。
@maodeng8888 你好,最新master代码,已经解决了你提到的 “问题1“ 和 ”问题2”,已经支持读取 “application.properties” 中的配置数据,可以pull最新代码体验下。
今日将会发布新版本,将会包含上述优化。
1.希望兼容 xxl-conf.propertie或者xxl-conf.yml 的配置形式; 2.建议xxl-conf.propertie 的配置改为类似xxl-job 配置文件的读取形式application.properties ,以便适用多环境配置时候比如application-dev.yml,application-test.yum ,采用xxl-conf.propertie 的里面的zookeeper 配置不能适用多环配置; 3、建议增加针对动态日志配置的专项功能,具体到包日志级别 public static void testLog(String key, String level){ LoggerContext loggerContext= (LoggerContext) LoggerFactory.getILoggerFactory(); if (!StringUtils.isEmpty(key)) { //设置某个类日志级别-可以实现定向日志级别调整 ch.qos.logback.classic.Logger vLogger = loggerContext.getLogger(key); if (vLogger!=null) { vLogger.setLevel(Level.toLevel(level2)); } } }