You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/06/29 04:41:00 UTC
[jira] [Commented] (LOG4J2-2878) How to change the level of the
appender
[ https://issues.apache.org/jira/browse/LOG4J2-2878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147544#comment-17147544 ]
Ralph Goers commented on LOG4J2-2878:
-------------------------------------
Appender's don't have a Level. The AppenderControl does but it isn't consistently used. On an Appender you would typically use a ThresholdFilter. You can also set the Level on the AppenderRef, but that may not affect all the ways to get to the Appender.
> How to change the level of the appender
> ----------------------------------------
>
> Key: LOG4J2-2878
> URL: https://issues.apache.org/jira/browse/LOG4J2-2878
> Project: Log4j 2
> Issue Type: Question
> Components: Appenders
> Affects Versions: 2.13.3
> Reporter: satish
> Priority: Major
>
> I am trying to change the Level programmatically .
> I am able to change the logger level using the loggerConfig, but I could not find a way to change the appender level.
> # Is there any code example that demonstrate how to change the appender level like we have :[http://logging.apache.org/log4j/2.x/manual/customconfig.html#Hybrid] for logger level change, as I see the level in appender is final.
> # To change appender level should we change the appender or appenderRef? if I change appenderRef of a logger then any other logger using the same appender will get same level. (I mean appender is a singleton)
> Thanks for your help in advance.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)