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

Ralph Goers commented on LOG4J2-1686:
-------------------------------------

The Script documentation referenced above describes in general how scripts may 
be used in Log4j. You would need to look at 
http://logging.apache.org/log4j/2.x/manual/layouts.html#Pattern_Selectors, 
http://logging.apache.org/log4j/2.x/manual/filters.html#Script, etc. for how 
scripts can be used in various places in the configuration.

In general, I am not in favor of adding programming logic to XML. The places I 
have seen that tried, such as Maven 1's use of Jelly, didn't turn out very 
well.  Furthermore, I don't believe that those expressions would work well in 
JSON, YAML or in properties files.

OTOH, It should be quite possible to use a script to generate a configuration 
using the ConfigurationBuilder API.

> 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