Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2878

How to change the level of the appender

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Information Provided
    • 2.13.3
    • None
    • Appenders
    • None

    Description

      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.

      1. 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.
      2. 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            satishk9826@gmail.com satish
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: