<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
#email-body { min-width: 30em !important; }
#email-page { padding: 8px !important; }
#email-banner { padding: 8px 8px 0 8px !important; }
#email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
#email-fields { padding: 0 8px 8px 8px !important; }
#email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
<tr valign="top">
<td id="email-page" style="padding:16px !important;">
<table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
<tr valign="top">
<td bgcolor="#003366" style="background-color:#003366;color:#ffffff;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="http://jira.qos.ch/s/en_USb9v8he-418945332/850/25/_/jira-logo-scaled.png" alt="" style="vertical-align:top;" /></td>
</tr><tr valign="top">
<td id="email-banner" style="padding:32px 32px 0 32px;">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
<img id="email-avatar" src="http://jira.qos.ch/secure/useravatar?avatarId=10122" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
<div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
<a class="user-hover" rel="tonowie" id="email_tonowie" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=tonowie" style="color:#326ca6;">Anton Wiedermann</a>
created <img src="http://jira.qos.ch/images/icons/issuetypes/bug.png" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-943'>LOGBACK-943</a>
</div>
<div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
<a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-943'><strong>Variable substitution does not work properly in logback.properties for variables with default</strong></a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td id="email-fields" style="padding:0 32px 32px 32px;">
<table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
<tr valign="top">
<td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Issue Type:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="http://jira.qos.ch/images/icons/issuetypes/bug.png" height="16" width="16" border="0" align="absmiddle" alt="Bug"> Bug
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Affects Versions:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
1.0.13 </td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Assignee:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="logback-dev@qos.ch" id="email_logback-dev@qos.ch" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=logback-dev%40qos.ch" style="color:#326ca6;">Logback dev list</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Created:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
27/Jan/14 6:04 PM
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Description:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<p style='margin-top:0;margin-bottom:10px;'>In an attempt to upgrade to latest logback I hit problem with new version not being able to properly replace variable value if that variable has defualt. Version which I am upgrading from is 0.9.24 so I can not really tell when this was introduced. I searched Jira and found issues where similar functionality was not working (leaving bracket behind) but this is different problem.</p>
<p style='margin-top:0;margin-bottom:10px;'>Simplified definition of what we have as appender</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag"><appender name=<span class="code-quote">"TRACE_FILE"</span> class=<span class="code-quote">"ch.qos.logback.core.rolling.RollingFileAppender"</span>></span>
...
<span class="code-tag"><file></span>${LOG_PATH}_trace.log<span class="code-tag"></file></span>
<span class="code-tag"><rollingPolicy class=<span class="code-quote">"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"</span>></span>
<span class="code-tag"><FileNamePattern></span>
${ARCHIVE_PATH}_trace_${ARCHIVE_SUFFIX}
<span class="code-tag"></FileNamePattern></span>
<span class="code-tag"><MaxHistory></span>10<span class="code-tag"></MaxHistory></span>
<span class="code-tag"></rollingPolicy></span>
...
<span class="code-tag"></appender></span>
</pre>
</div></div>
<p style='margin-top:0;margin-bottom:10px;'>and variables are defined in separate file logback.properties</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
LOG_HOME=${logfilepath.default:-logs}
LOG_PATH=${LOG_HOME}/${APP_NAME}
ARCHIVE_PATH=${LOG_HOME}/archive/${APP_NAME}
</pre>
</div></div>
<p style='margin-top:0;margin-bottom:10px;'>Above configuration fails for both RollingPolicy/FileNamePattern and appender/file with exceptions indicating that substitution for default value failed (exception below is for the RollingPolicy but same thing happens for appender/file when I correct the pattern for policy)</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
13:34:55,636 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
13:34:55,652 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [TRACE_FILE]
13:34:55,744 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.boolex.JaninoEventEvaluator] for [evaluator] property
13:34:56,005 |-INFO in ch.qos.logback.classic.boolex.JaninoEventEvaluator@14bc1199 - Adding [return] prefix and a semicolon suffix. Expression becomes [return marker!=null && "audit".equals(marker.getName());]
13:34:56,005 |-INFO in ch.qos.logback.classic.boolex.JaninoEventEvaluator@14bc1199 - See also http://logback.qos.ch/codes.html#block
13:34:56,423 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use zip compression
13:34:56,429 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy - Will use the pattern ${logfilepath.default:-logs}/archive/comms_trace_%d{yyyyMMddHHmm}.log for the active file
13:34:56,439 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyyMMddHHmm' from file name pattern '${logfilepath.default:-logs}/archive/comms_trace_%d{yyyyMMddHHmm}.log.zip'.
13:34:56,439 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over every minute.
13:34:56,446 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to Tue Jan 21 13:34:56 CET 2014
13:34:56,516 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@28:16 - RuntimeException in Action for tag [appender] java.util.regex.PatternSyntaxException: Illegal repetition near index 0
${logfilepath.default:-logs}/archive/comms_trace_\d{4}\d{2}\d{2}\d{2}\d{2}.log.zip
^
at java.util.regex.PatternSyntaxException: Illegal repetition near index 0
${logfilepath.default:-logs}/archive/comms_trace_\d{4}\d{2}\d{2}\d{2}\d{2}.log.zip
^
at at java.util.regex.Pattern.error(Pattern.java:1924)
at at java.util.regex.Pattern.closure(Pattern.java:3104)
at at java.util.regex.Pattern.sequence(Pattern.java:2101)
at at java.util.regex.Pattern.expr(Pattern.java:1964)
at at java.util.regex.Pattern.compile(Pattern.java:1665)
at at java.util.regex.Pattern.<init>(Pattern.java:1337)
at at java.util.regex.Pattern.compile(Pattern.java:1022)
at at java.util.regex.Pattern.matches(Pattern.java:1128)
at at java.lang.String.matches(String.java:2063)
at at ch.qos.logback.core.rolling.RollingFileAppender.fileAndPatternCollide(RollingFileAppender.java:96)
at at ch.qos.logback.core.rolling.RollingFileAppender.start(RollingFileAppender.java:67)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
...
</pre>
</div></div>
<p style='margin-top:0;margin-bottom:10px;'>Changing the logback.properties to following resolves the problem</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-none">
LOG_PATH=${logfilepath.default:-logs}/${APP_NAME}
ARCHIVE_PATH=${logfilepath.default:-logs}/archive/${APP_NAME}
</pre>
</div></div>
<p style='margin-top:0;margin-bottom:10px;'>Unfortunately we can not release that to customers for reasons which are beyond this issue. Old version of logback does not roll files which do not get written every day so we need to upgrade...</p>
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Environment:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<p style='margin-top:0;margin-bottom:10px;'>Java 7u25 64bit, Logback 1.0.13, SLF4J 1.7.5</p>
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Project:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a style="color:#326ca6;" href="http://jira.qos.ch/browse/LOGBACK">logback</a>
</td>
</tr> <tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Labels:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
rollingFileappender
substitution
default
variable
properties
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Priority:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<img src="http://jira.qos.ch/images/icons/priorities/major.png" height="16" width="16" border="0" align="absmiddle" alt="Major"> Major
</td>
</tr>
<tr valign="top">
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
<strong style="font-weight:normal;color:#505050;">Reporter:</strong>
</td>
<td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
<a class="user-hover" rel="tonowie" id="email_tonowie" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=tonowie" style="color:#326ca6;">Anton Wiedermann</a>
</td>
</tr> </table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td><!-- End #email-page -->
</tr>
<tr valign="top">
<td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
This message is automatically generated by JIRA.<br />
If you think it was sent incorrectly, please contact your JIRA administrators<br />
For more information on JIRA, see: <a style='color:#326ca6;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
</td>
</tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->