spring - Can I move Spring Boot logging settings out of application.properties file and into an untracked file?
问题描述
I am working on building a SpringBoot app with my workmates. We all have different preferred logging levels for the app. We have been battling back and forth with each other's logging changed to application.properties. Is there a way to move all of the logging.level.*
stuff out of that application.properties file and into a ~logging.properties file or something? That way we can add that file to the .gitignore and not track that file so we can each leave our logging alone. We are using Java annotations and not xml btw.
I've tried adding @PropertySource("classpath:logging.properties")
to the application file, but I read somewhere that the logging gets setup early on in the init process and this won't work. I tried it anyway and it doesn't work (so confirmed I guess).
I can't believe there's isn't more info on this out there.. I'd imagine the members of a dev team each want their own custom level of logging and don't want to keep stepping on each other's toes/commits.
解决方案
您可以使用命令行属性覆盖它。回退策略将命令行 -D args 作为最高优先级。
推荐阅读
- r - 使一个变量中的两个数据点为一种颜色,而其余为另一种颜色
- c++ - 使用 -funwind-tables 编译时究竟会发生什么?
- javascript - 如何在javascript中比较同一数组中的不同对象
- neural-network - 区分人工神经网络中的学习和记忆
- php - PHP SQL LEFT JOIN 多个值
- vue.js - 使用 ASP.net Core 2.0 应用程序在 IIS 上托管时出现 VueJs Url 重写错误
- git - GitHub 合作者私人档案
- php - laravel 获取当前登录用户的数据
- ios - 可选的通用参数 - 无法推断通用参数“T”
- c# - 如何在 MVC 项目之间共享 React jsx 文件?