使用 ConfigServer 管理 logging.level [英] Managing logging.level using ConfigServer

查看:16
本文介绍了使用 ConfigServer 管理 logging.level的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 1.1.9.RELEASE 的 Spring Boot 应用

Spring Boot application using 1.1.9.RELEASE

尝试在最简单的情况下设置日志

Trying to setup logging in the simplest case

logging:
  level:
    org.springframework.web: DEBUG

场景 1:将以上几行添加到/resources 中的 application.yml - WORKS

Scenario 1: adding above lines to application.yml in /resources - WORKS

场景 2:将这些行添加到配置服务器使用的 github 存储库时,应用程序似乎没有使用它.只是为了确保调用/env 端点产生以下输出

Scenario 2: when adding these lines to github repo used by config server however application does not seems to use it. Just to make sure calling /env endpoint produces the following output

configService:https://github.com/myrepo/config/file:/mypath/transportation.yml:   {
      logging.level.org.springframework.integration: "DEBUG",
      logging.level.org.springframework.web: "TRACE",
      logging.level.org.springframework.ws: "TRACE",
      ...
} 

因此环境似乎正确加载.此外,如果我将 logging.level 行添加到 bootstrap.yml 中,它会一直工作,直到从配置服务器加载新环境(我可以看到 DEBUG 级别输出)

So Environment seems to load correctly. Also if I add logging.level lines into bootstrap.yml it works until new environment loaded from the config server (I can see DEBUG level output)

我是否遗漏了什么,或者在日志记录级别和配置服务器方面存在某种限制?

Am I missing something or there is some sort of limitation regarding logging levels and configserver?

推荐答案

对我有用.您是否记得刷新应用程序(例如 POST 到/refresh)以传播更改?

Works for me. Did you remember to refresh the application (e.g. POST to /refresh) to propagate the change?

这篇关于使用 ConfigServer 管理 logging.level的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆