History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LBCLASSIC-224
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ceki Gulcu
Reporter: David Harrigan
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
logback-classic

Use of default values in appender-refs

Created: 19/May/10 04:02 PM   Updated: 13/Oct/10 07:51 PM
Component/s: joran
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Text File 0001-Add-in-the-modified-files-for-LBCORE-154-into-the-co.patch (4 kb)
2. Text File 0001-Revert-Fix-for-http-jira.qos.ch-browse-LBCORE-154.patch (16 kb)
3. Text File 0001-This-is-a-cleaned-up-version-for-LBCORE-154.-It-undo.patch (2 kb)

Environment: All


 Description  « Hide
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=-

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
David Harrigan - 02/Jul/10 05:04 PM
Hiya,

Now that I have some time, please find attached a patch for this request.

-=david=-

David Harrigan - 11/Sep/10 12:56 AM
This another attempt, this time the code has been formatted properly in line with the code formatting conventions. I hope it is okay. If not, please do let me know.

-=david=-