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:
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
According to the Duration API that you posted, you can also use (without the space):
<configuration scan="${scan:-true}" scanPeriod="${scan-interval:-10minutes}">
private static final Pattern DURATION_PATTERN = Pattern.compile(DOUBLE_PART
+ "\\s*" + UNIT_PART, Pattern.CASE_INSENSITIVE);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With