Pav*_*dko 4 spring logback spring-logback
这是我的简化 logback-spring.xml 配置:
<configuration>
<!-- appender config -->
<springProfile name=dev>
<!-- dev specific config here -->
</springProfile>
<springProfile name=prod>
<!-- prod specific config here -->
</springProfile>
<!-- other profiles -->
</configuration>
Run Code Online (Sandbox Code Playgroud)
当我使用不同的配置文件运行我的应用程序时,我想获得一些默认的日志配置。我找不到有关在logback-spring.xml.
请注意,定义了 2 个以上的配置文件,并且我不知道其他临时配置文件的名称。
谢谢,帕夫洛
你可以这样定义它:
<configuration>
<!-- appender config -->
<springProfile name=dev>
<!-- dev specific config here -->
</springProfile>
<springProfile name=prod>
<!-- prod specific config here -->
</springProfile>
<!-- other profiles -->
<springProfile name="!(dev| prod)">
<!-- other specific config here -->
</springProfile>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4901 次 |
| 最近记录: |