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

RollingRandomAccessFileManager throws NPE in closeOutputStream on shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.11.1
    • None
    • Appenders
    • None

    Description

      In configuration where RollingRandomAccessFile appender is used together with DirectWriteRolloverStrategy strategy and no messages got logged in a session I'm getting NullPointerException when closing the application.

      Exception call stack is:

      2018-11-16 13:53:01,221 pool-1-thread-1 ERROR Caught exception executing shutdown hook null java.lang.NullPointerException
      at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFileManager.closeOutputStream(RollingRandomAccessFileManager.java:168)
      at org.apache.logging.log4j.core.appender.OutputStreamManager.releaseSub(OutputStreamManager.java:136)
      at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.releaseSub(RollingFileManager.java:266)
      at org.apache.logging.log4j.core.appender.AbstractManager.stop(AbstractManager.java:86)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.stop(AbstractOutputStreamAppender.java:142)
      at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.stop(RollingRandomAccessFileAppender.java:223)
      at org.apache.logging.log4j.core.config.AbstractConfiguration.stop(AbstractConfiguration.java:360)
      at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:353)
      at org.apache.logging.log4j.core.LoggerContext$1.run(LoggerContext.java:281)
      at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry$RegisteredCancellable.run(DefaultShutdownCallbackRegistry.java:109)
      at org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry.run(DefaultShutdownCallbackRegistry.java:74)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Blindfold Denis Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: