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

JAR file containing Log4j configuration isn't closed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14.0
    • 2.18.0
    • Core
    • None
    • Windows

    Description

      If the Log4j configuration file is inside of a JAR file, then the JAR file (which is backed by the JarURLConnection retrieved from URL.openConnection) isn't closed.

      This causes problems on Tomcat running on Windows during undeploying of an application, because the opened JAR file can't be deleted.

      The problem was introduced during implementation of LOG4J2-2901 (version 2.14.0), where the URL.openStream was replaced by URL.openConnection in the class org.apache.logging.log4j.core.config.ConfigurationSource.

      The proposed solution (https://github.com/apache/logging-log4j2/pull/780) is to use the URL.openConnection only when needed (~ configuration URL has HTTPS protocol), otherwise similar code as in previous versions (<= 2.13.3) would be used.

       

      Attachments

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              rtlusty Radim Tlusty
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: