Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 无法在引导时从领事处读取日志记录配置_Spring Boot_Spring Cloud_Spring Cloud Consul - Fatal编程技术网

Spring boot 无法在引导时从领事处读取日志记录配置

Spring boot 无法在引导时从领事处读取日志记录配置,spring-boot,spring-cloud,spring-cloud-consul,Spring Boot,Spring Cloud,Spring Cloud Consul,我正在为基于spring boot的RESTful服务使用logback配置。 我的一些日志配置属性驻留在领事的KV存储中(如smtp主机)。我还在我的hystrix配置项目中使用“SpringCloudStarter” 对于配置,我使用“logback spring.xml”,这样我就可以通过“springProperty”标记访问logback配置中的spring上下文 现在,我的问题是,在引导时,bootstrapplicationlistener被调用,它读取所有引导资源(bootstr

我正在为基于spring boot的RESTful服务使用logback配置。 我的一些日志配置属性驻留在领事的KV存储中(如smtp主机)。我还在我的hystrix配置项目中使用“SpringCloudStarter”

对于配置,我使用“logback spring.xml”,这样我就可以通过“springProperty”标记访问logback配置中的spring上下文

现在,我的问题是,在引导时,bootstrapplicationlistener被调用,它读取所有引导资源(bootstrap.properties)并加载日志系统。此时,尚未加载领事配置(ConsultAutoConfiguration),因此未找到所需的日志记录配置,因此未正确初始化回写

是否有办法在执行BootstrapApplicationListener之前或期间加载领事配置,以便日志系统正确初始化

或者,在读取concur属性后,是否有其他方法可以重置日志系统


谢谢。

可能有鸡和蛋的问题。您使用的是spring cloud starter领事配置(或-all)?是的,我使用的是spring-cloud-starter-领事配置。Bootstrap
Bootstrap Application Listener
是为加载远程属性而创建的,因此在此之前它们不能出现。如果
logging.level.*
键已更改,则会有一个更新记录器的命令。也许你可以写一些类似的东西?谢谢@Spencergib。这就是我想知道的。我只是想知道是否有办法使用默认值。但是,事实证明,我必须为它写一些定制的东西。再次感谢。