logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leon Finker (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1313) <Property name="" value="" /> not working
Date Fri, 09 Sep 2016 14:27:20 GMT

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

Leon Finker commented on LOG4J2-1313:
-------------------------------------

This caused a regression in sys properties lookup/substitution per below. I don't have permission
to re-open the ticket. Maybe someone else from log4j2 dev can re-open it please. Thanks

{noformat}
From: Remko Popma <remko.popma@gmail.com>
To: Log4J Developers List <log4j-dev@logging.apache.org>
Subject: Re: "sys" properties lookup regression
Date: 2016-09-08 18:22 (-0400)
List: log4j-dev@logging.apache.org

Good catch!
This must be a regression caused by the change made to support value attribute in Property
elements (https://issues.apache.org/jira/browse/LOG4J2-1313)

> On 2016/09/09, at 6:48, Leon Finker <leonfin@gmail.com> wrote:
> 
> Hi,
> 
> Testing master branch.. We have the following xml configuration:
> ..
> <Property name="additionalProp"></Property>
> ..
> <RegexFilterEx regex="${sys:additionalProp}" onMatch="DENY"
>                onMismatch="ACCEPT" />
> -- or you can have <Property name="additionalProp" /> doesn't matter for the issue
> 
> And assume there is no 'additionalProp' System property set.  On master branch, ${sys:additionalProp}
doesn't get resolved and remains as literal ${sys:additionalProp}. It's supposed to default
to xml specified props, no? This worked up to 2.6.3.
> 
> But if I change the xml prop to be:
> <Property name="additionalProp" value="" /> 
> 
> Then ${sys:additionalProp} fallsback to xml defined prop and resolves to empty string.
{noformat}

> <Property name="" value="" /> not working
> -----------------------------------------
>
>                 Key: LOG4J2-1313
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1313
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.5
>            Reporter: Philipp Knobel
>            Assignee: Remko Popma
>             Fix For: 2.7
>
>
> The documentation shows examples of the property tag like this ([http://logging.apache.org/log4j/2.x/manual/configuration.html#ConfigurationSyntax]):
> {noformat}
> <Properties>
>     <Property name="name1">value</property>
>     <Property name="name2" value="value2"/>
>   </Properties>
> {noformat}
> When using the later one with the value attribute you'll get on startup this error:
> {noformat}
> ERROR Property contains an invalid element or attribute "value"
> {noformat}
> It would be good to have the attribute support working as well, as otherwise it might
happen that IDE auto formatting is line breaking an attribute. If this isn't possible please
update the documentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message