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

Raman Gupta commented on LOG4J2-1686:
-------------------------------------

That *seems* promising, but perhaps the docs need some improvement. For 
example, the example references an element `PatternMatch` that, as far as I can 
tell, has no corresponding documentation at all (a search on the page shows 
nothing except the two usages in the example). I can *guess* that it is 
creating a `PatternLayout`, keyed on the result of the referenced script, but 
without looking at the source I can't really be sure.

In addition, is the only capability of a script to feed to `PatternMatch` 
elements i.e. select patterns conditionally?

Conditional support in logback allows any configuration element to be made 
conditional -- if scripting in log4j2 works the way I'm guessing, that means 
that there has to be a corresponding `Match` element to every element that 
needs to be made conditional. That isn't a very general or elegant solution.

> Support conditional configuration
> ---------------------------------
>
>                 Key: LOG4J2-1686
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1686
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Configurators
>    Affects Versions: 2.7
>            Reporter: Raman Gupta
>            Priority: Blocker
>
> It would be great to support conditional configuration like logback:
> http://logback.qos.ch/manual/configuration.html#conditional
> This allows for more advanced configuration than is currently possible with 
> property substitution.
> Example use case: to implement 
> https://issues.apache.org/jira/browse/LOG4J2-1685 without log4j library 
> support.



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

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

Reply via email to