[logback-dev] [JIRA] Created: (LBCORE-154) Use of default values in appender-refs

David Harrigan (JIRA) noreply-jira at qos.ch
Wed May 19 16:03:16 CEST 2010


Use of default values in appender-refs
--------------------------------------

                 Key: LBCORE-154
                 URL: http://jira.qos.ch/browse/LBCORE-154
             Project: logback-core
          Issue Type: Improvement
          Components: Appender
         Environment: All
            Reporter: David Harrigan
            Assignee: Logback dev list


This is referenced also here: http://old.nabble.com/Appender-Ref-Default-Value-to28605941.html

Please can we have the ability to specify default values for appender-refs. I have a use case where we need to "bake-in" the appender during build-time. I can do this at the moment for logger level by bringing in a property file (called override.properties) that can reset the logging level (which is dependent on the deployment environment and other factors).

Here is a little example:

    <property resource="override.properties" />

    <logger name="bar.foo" level="${bar.foo.log.level:-info}" additivity="false">
        <appender-ref ref="console"/>
    </logger>

The bar.foo.log.level is defined in the override.properties file. The correct file gets inserted for each build type.

I would like to do the following as well:

    <logger name="bar.foo" level="${bar.foo.log.level:-info}" additivity="false">
        <appender-ref ref="${bar.foo.log.appender:-console}"/>
    </logger>

So that I can tell the override where to log to (console for development or log file, or smtp, or jms, or db for other environments).

This would be so neato if implemented :-)

Thank you.

-=david=-

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list