[
https://issues.apache.org/jira/browse/LOG4J2-1686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15664359#comment-15664359
]
Raman Gupta commented on LOG4J2-1686:
-------------------------------------
I like the idea of `ScriptPropertiesSelector`. Though, for consistency, I guess
that should be `<PropertiesMatch key="dev">`. This would be useful for other
use cases as well. And I think this for most use cases this could be simplified
to avoid the script, and just use a property value directly:
{code:xml}
<PropertyPropertiesSelector ref="${envProperty}">
<Properties key="dev">
<Property name="loggerALevel">DEBUG</Property>
</Properties>
<Properties key="prod">
<Property name="leggerALevel">INFO</Property>
</Properties>
</PropertyPropertiesSelector>
{code}
I still think `ScriptLoggerSelector` would be useful though. Less abstraction
and fewer co-dependencies in the config file when adding/removing loggers in
comparison to using ScriptPropertiesSelector/PropertyPropertiesSelector. With
the latter, I have to remember to define the logger *and* the associated
property, whereas the former I just define the loggers I want, where I want
them, with the level I want them at all in one place.
> 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]