-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Springboot系列之—动态配置logback路径 #58
Labels
Comments
请问这个可以在项目启动后进行动态修改日志目录吗 |
没试过,应该是可行的,您可以参考下: |
这个是在启动的时候注入的,后续好像修改不了了 |
使用@value 是需要重启的,需要手动设置environment才行 |
可以吗? |
打成Jar包就不行了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
场景
公司有个给客户定制的项目,有个需求是:项目中常见的配置,需要全部迁移到客户内部的 “配置中心”,然后项目启动的时候,动态从“配置中心”拉去配置,初始化:数据源、日志路径等。
项目运行环境:
对于数据源来说,配置相对容易,但是在动态配置logback日志打印路径时,遇到一些问题,最终使用下面比较轻量的方式解决:
解决方法
1、创建 PropertyDefinerBase 类
2、修改logback配置文件
3、修改application.properties
The text was updated successfully, but these errors were encountered: