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

Log4JBridgeHandler & Tomcat Webapps: Propagating log levels leads to no handlers in the (root) logger

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.19.0
    • 2.20.0
    • JUL adapter
    • None
    • Apache Tomcat 9.0.68

      JDK Corretto 18

      macOS 12.6.1 aarch64

    Description

      In short: The loggers are altered before the handlers are added to the (root) logger. This leads to propers loggers but without any handler.

      My idea would be to move the propagation to a later point in time. So, I moved it to the method publish(). 

      Here is demo repo to reproduce the issue: https://github.com/mknet/tomcat-webapp-log4j-jul-bridge

      Here is the Pull Request with my approach to fix the issue: https://github.com/apache/logging-log4j2/pull/1140

      Attachments

        Issue Links

          Activity

            People

              pkarwasz Piotr Karwasz
              mknet Marcel Koch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: