Appender Ref Default Value

Hiya, I love the fact that in logback I can do this for a level: <logger name="foo" level="${foo.bar.log.level:-debug}"/> I would love to be able to do the following as well: <appender-ref ref="${foo.bar.log.appender:-console}"/> So that I can switch between different appenders during build time. At the moment, If I try that, I get this warning from logback (0.9.21) 11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [${foo.bar.log.appender:-console}]. Did you define it below in the config file? 11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details. Is this achievable? -=david=- -- View this message in context: http://old.nabble.com/Appender-Ref-Default-Value-tp28605941p28605941.html Sent from the Logback User mailing list archive at Nabble.com.

Hi David, The feature your are asking for is definitely possible. If you file a jira issue, I'll happily add it. By the way, the type of variable substitution is supported quite naturally in .groovy configuration files I am currently working on. On 19/05/2010 11:30 AM, David Harrigan wrote:
Hiya,
I love the fact that in logback I can do this for a level:
<logger name="foo" level="${foo.bar.log.level:-debug}"/>
I would love to be able to do the following as well:
<appender-ref ref="${foo.bar.log.appender:-console}"/>
So that I can switch between different appenders during build time. At the moment, If I try that, I get this warning from logback (0.9.21)
11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [${foo.bar.log.appender:-console}]. Did you define it below in the config file? 11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.
Is this achievable?
-=david=-

Hiya, Which component should I create an issue under? logback-core logback-classic ...? -=david=- Ceki Gulcu wrote:
Hi David,
The feature your are asking for is definitely possible. If you file a jira issue, I'll happily add it.
By the way, the type of variable substitution is supported quite naturally in .groovy configuration files I am currently working on.
On 19/05/2010 11:30 AM, David Harrigan wrote:
Hiya,
I love the fact that in logback I can do this for a level:
<logger name="foo" level="${foo.bar.log.level:-debug}"/>
I would love to be able to do the following as well:
<appender-ref ref="${foo.bar.log.appender:-console}"/>
So that I can switch between different appenders during build time. At the moment, If I try that, I get this warning from logback (0.9.21)
11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - Could not find an appender named [${foo.bar.log.appender:-console}]. Did you define it below in the config file? 11:17:32,676 |-ERROR in ch.qos.logback.core.joran.action.AppenderRefAction - See http://logback.qos.ch/codes.html#appender_order for more details.
Is this achievable?
-=david=-
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://old.nabble.com/Appender-Ref-Default-Value-tp28605941p28607302.html Sent from the Logback User mailing list archive at Nabble.com.

Hiya, Done :-) http://jira.qos.ch/browse/LBCORE-154 -=david=- Ceki Gulcu wrote:
It does not really matter, but preferably logback-core.
On 19/05/2010 2:12 PM, David Harrigan wrote:
Hiya,
Which component should I create an issue under?
logback-core logback-classic ...?
-=david=-
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://old.nabble.com/Appender-Ref-Default-Value-tp28605941p28608704.html Sent from the Logback User mailing list archive at Nabble.com.

Hiya, Now that I had some time, I've created a patch which I have now attached to the JIRA ticket. -=david=- David Harrigan wrote:
Hiya,
Done :-)
http://jira.qos.ch/browse/LBCORE-154
-=david=-
Ceki Gulcu wrote:
It does not really matter, but preferably logback-core.
On 19/05/2010 2:12 PM, David Harrigan wrote:
Hiya,
Which component should I create an issue under?
logback-core logback-classic ...?
-=david=-
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://old.nabble.com/Appender-Ref-Default-Value-tp28605941p29057394.html Sent from the Logback User mailing list archive at Nabble.com.
participants (2)
-
Ceki Gülcü
-
David Harrigan