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

when we set the property "monitorInterval" and appenders/loggers are getting messed-up

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.13.3
    • None
    • Appenders
    • None

    Description

      Hi Team,

      Our product is consuming the log4j2.x version 2.13.3. We have a requirement to detect the changes made to log4j2.properties file and apply those changes to log4j  automatically in the runtime. To achieve this requirement we are using the "monitorInterval" in the log4j2.properties file.  

      what happens is, the changes to the log4j2.properties file are getting applied i.e. if we change the log level from WARN to DEBUG, the changes are being applied, I could see the debug level messages in the log file.

      Here issue is, our component has, it's own tracing which is aspectJ based. For tracing, component has its own loggers/appenders i.e. trace information would go to the file called dfctrace.log, at the same time, component also has log4j logging, the log4j logging would go to the file called log4j.log.

      While tracing is on and with the property "monitorInterval" configured in the log4j2.properties, when we do changes to the log4j.properties file (i.e. log level change from WARN to DEBUG), the trace information is getting written to the log4j.log instead of dfctrace.log.

      Here somehow log4j2 is making the loggers/appenders messed-up when log4j applies the changes made to the log4j.properties file.

      Could you verify why log4j is not keeping the loggers/appenders in previous state when it applies the changes made to the log4j.properties file.

      Please let me know, for any further information.

      Thanks,

      Ananda Reddy C

      Attachments

        1. image-2020-09-10-20-57-53-861.png
          21 kB
          Yuanzhe Geng
        2. log4j2.properties
          2 kB
          Ananda Reddy C

        Activity

          People

            Unassigned Unassigned
            reddya Ananda Reddy C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: