[logback-dev] [JIRA] Commented: (LBCORE-230) System Properties should override properties in logback.xml (not the other way around)

Eric Sirianni (JIRA) noreply-jira at qos.ch
Thu Oct 27 22:36:12 CEST 2011


    [ http://jira.qos.ch/browse/LBCORE-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12236#action_12236 ] 

Eric Sirianni commented on LBCORE-230:
--------------------------------------

I guess I see what you're saying from a scoping perspective, but you can look at this another way.

With most applications I know, option values specified on the command-line override those specified in config files.  By this reasoning, since System properties are specified on the commandline, they should override properties in config files (which are typically checked into source control and embedded in JARs at runtime).

See Spring's PropertyPlaceholderConfigurer as an example:
Check system properties first, before trying the specified properties. This allows system properties to override any other property source. 

http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html#SYSTEM_PROPERTIES_MODE_OVERRIDE

> System Properties should override properties in logback.xml (not the other way around)
> --------------------------------------------------------------------------------------
>
>                 Key: LBCORE-230
>                 URL: http://jira.qos.ch/browse/LBCORE-230
>             Project: logback-core
>          Issue Type: Improvement
>    Affects Versions: 0.9.29
>            Reporter: Eric Sirianni
>            Assignee: Logback dev list
>            Priority: Minor
>
> From the logback configuration guide (http://logback.qos.ch/manual/configuration.html)
> "The property is not declared in the configuration file, thus logback will look for it in the System properties. Java system properties can be set on the command line. "
> I believe the precedence should be reversed.  Typically, system properties are used to *override* default values of properties that are specified in XML files or property files (typically checked into source control).  Please consider this enhancement.  For backwards compatibility you may want to add an option to toggle the precedence ordering.

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