[logback-user] Appender Ref Default Value

Ceki Gülcü ceki at qos.ch
Wed May 19 13:00:17 CEST 2010


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=-
>



More information about the Logback-user mailing list