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

Raman Gupta edited comment on LOG4J2-1686 at 11/14/16 2:15 AM:
---------------------------------------------------------------

That *seems* promising, but perhaps the docs need some improvement. For 
example, the example references a elements `ScriptPatternSelector` and 
`PatternMatch` that, as far as I can tell, have 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.

There is also an (unexplained) reference to <ScriptFilter> which presumably 
does filtering programmatically. Are these the only capabilities of a script?

In any case, it certainly appears that each action based on the result of a 
script needs some explicit support and corresponding elements. This doesn't 
seem to be a very general or elegant solution to conditional configuration. 
Conditional support in logback allows any configuration element to be made 
conditional, and it doesn't subvert the normal configuration mechanism by 
requiring new elements for each type of condition that someone may want.


was (Author: rocketraman):
That *seems* promising, but perhaps the docs need some improvement. For 
example, the example references a elements `ScriptPatternSelector` and 
`PatternMatch` that, as far as I can tell, have 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.

There is also an (unexplained) reference to <ScriptFilter> which presumably 
does filtering programmatically. Are these the only capabilities of a script?

In any case, it certainly appears that each action based on the result of a 
script needs some explicit support and corresponding elements. This doesn't 
seem to be a very general or elegant solution to conditional configuration. 
Conditional support in logback allows any configuration element to be made 
conditional.

> 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