Logback 无法识别 scanPeriod 属性的变量替换
我正在尝试使用 scanPeriod
属性的变量替换,以便我可以拥有多个环境文件。
Logback 似乎无法识别某些属性的变量替换。
例如scanPeriod
属性:
Logback配置:
<configuration scan="${scan:-true}" scanPeriod="${scan-interval:-10 minutes}">
指定取默认值10分钟logback属性未定义。
Logback 属性:
scan=true
scan-interval=30 seconds
此属性应覆盖 10 分钟的默认配置。
Logback错误:
java.lang.IllegalArgumentException: String value [${scan-interval:-10 minutes}] is not in the expected format.
根据Duration API,持续时间格式正确。
这是使用:
- slf4j 1.6.2
- logback classis 0.9.30
- logback core 0.9.30
编辑:为此提交了 Jira 报告 - http://jira.qos.ch/browse/LBCLASSIC-307
更新: 2011 年 12 月 28 日这被标记为 Major,并由 Ceki Gulcu 进行查看。 :D
更新: 2012 年 6 月 12 日 仍然没有更新。在 JIRA 中留下评论。
更新: 2012 年 7 月 12 日被接受为有效错误。 1.0.7 中修复
I am trying to use variable substitution for the scanPeriod
property such that i can have multiple environment files.
It seems like Logback is unable to recognize variable substitution for certain properties.
For example the scanPeriod
property:
Logback configuration:
<configuration scan="${scan:-true}" scanPeriod="${scan-interval:-10 minutes}">
Specified to take default value of 10 minutes of logback property is not defined.
Logback properties:
scan=true
scan-interval=30 seconds
This property should override the default configuration of 10 minutes.
Logback error:
java.lang.IllegalArgumentException: String value [${scan-interval:-10 minutes}] is not in the expected format.
According to the Duration API, the duration format is correct.
This is using:
- slf4j 1.6.2
- logback classis 0.9.30
- logback core 0.9.30
EDIT: Filed a Jira report for this - http://jira.qos.ch/browse/LBCLASSIC-307
UPDATE:
28 Dec 2011 This is marked as a Major, and looked at by Ceki Gulcu. :D
UPDATE:
12 Jun 2012 Still no updates. Left comment in JIRA.
UPDATE:
12 July 2012 Accepted as a valid bug. To fix in 1.0.7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您发布的 Duration API,您还可以使用(没有空格):
According to the Duration API that you posted, you can also use (without the space):
http://jira.qos.ch/browse/LOGBACK-396
接受为有效bug并在1.0.7中修复
http://jira.qos.ch/browse/LOGBACK-396
Accepted as a valid bug and to be fixed in 1.0.7