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

shutdown hook called too early

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-rc1, 2.0-rc2, 2.0.2
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      Hi

      this issue follow few mail exchanges from the commons list. Here the interesting part for log4j2:

      Here what I do (we can move it to another thread since that's 100% log4j2 related):
      unzip apache-tomee-1.7.0-SNAPSHOT-webprofile.zip &&
      cd apache-tomee-webprofile-1.7.0-SNAPSHOT/ &&
      rm conf/logging.properties &&
      echo 'openejb.log.factory=log4j'>conf/system.properties &&
      cp ~/log4j2.xml conf/log4j2.xml &&
      cp ~/.m2/repository/org/apache/logging/log4j/log4j-api/2.0-rc2-SNAPSHOT/log4j-api-2.0-rc2-SNAPSHOT.jar lib/ &&
      cp ~/.m2/repository/org/apache/logging/log4j/log4j-core/2.0-rc2-SNAPSHOT/log4j-core-2.0-rc2-SNAPSHOT.jar lib/ &&
      cp ~/.m2/repository/org/apache/logging/log4j/log4j-1.2-api/2.0-rc2-SNAPSHOT/log4j-1.2-api-2.0-rc2-SNAPSHOT.jar lib/ &&
      ./bin/catalina.sh

      it makes server starting with log4j2 logs, if you ctrl+c logs are not printed. Sure it is cause context is closed too early and then loggers have NullConfiguration. (If I debug in java.lang.ApplicationShutdownHooks#runHooks to wait all hooks exec it works)

      Basically the issue is that when shutting down with ctrl+C some logs are swallowed.

        Attachments

          Activity

            People

            • Assignee:
              mattsicker Matt Sicker
              Reporter:
              romain.manni-bucau Romain Manni-Bucau
            • Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: