You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Fabrice Daugan (JIRA)" <ji...@apache.org> on 2018/01/17 09:37:00 UTC

[jira] [Commented] (LOG4J2-2197) Default system property value support

    [ https://issues.apache.org/jira/browse/LOG4J2-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16328542#comment-16328542 ] 

Fabrice Daugan commented on LOG4J2-2197:
----------------------------------------

Nice, it should be documented there : https://logging.apache.org/log4j/2.x/manual/lookups.html

> Default system property value support
> -------------------------------------
>
>                 Key: LOG4J2-2197
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2197
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Lookups
>    Affects Versions: 2.10.0
>            Reporter: Fabrice Daugan
>            Priority: Major
>
> As Spring and some other libraries, it would be nice to support default property value. For sample : 
> {{$\{sys:property_name:default_value}}}
> Lookup will return the actual system property value of "property_name" if defined, otherwise "default_value".
> The form without default value would work as normal and return a "null" value when this property is not defined.
> The way of getting the default value will be similar to "ResourceBundleLookup" and both "EnvironmentLookup" and "SystemPropertiesLookup" will benefit this feature.
> Patch incoming...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)