[
https://issues.apache.org/jira/browse/LOG4J2-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15662760#comment-15662760
]
Raman Gupta edited comment on LOG4J2-1686 at 11/14/16 4:50 AM:
---------------------------------------------------------------
You seem to have missed my key criticism and one possible solution: "allow
*any* element to have `key` and `keyScript` attributes". This means, one could
just as easily do something like this:
{code:xml}
<Appenders>
<Console key="key1" keyScript="selector">
<...>
</Console>
<FileAppender key="key2" keyScript="selector">
...
</FileAppender>
</Appenders>
{code}
To do the equivalent of this with the current mechanism, now you have to make
an `AppenderSelector`. Then you have to make a `LoggerSelector`. And on and on.
Its not a general conditional solution.
was (Author: rocketraman):
You seem to have missed my key criticism and one possible solution: "allow
*any* element to have `key` and `keyScript` attributes". This means, one could
just as easily do something like this:
{code:xml}
<Appenders>
<Console key="key1" keyScript="selector">
<...>
</Console>
<FileAppender key="key2" keyScript="selector">
...
</FileAppender>
</Appenders>
{code}
To do this with the same approach, now you have to make an `AppenderSelector`.
Then you have to make a `LoggerSelector`. And on and on. Its not a general
conditional 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: [email protected]
For additional commands, e-mail: [email protected]