Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: 2.0-rc1, 2.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      java version "1.6.0_65"
      Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
      Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

      Description

      ThresholdFilter throws NPE after LoggerContext#reconfigure() is performed.

      [java] SEVERE: Exception processing: 662 org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapper@55573de0
      [java] java.lang.NullPointerException
      [java] at org.apache.logging.log4j.core.filter.ThresholdFilter.filter(ThresholdFilter.java:70)
      [java] at org.apache.logging.log4j.core.filter.ThresholdFilter.filter(ThresholdFilter.java:66)
      [java] at org.apache.logging.log4j.core.filter.AbstractFilterable.isFiltered(AbstractFilterable.java:124)
      [java] at org.apache.logging.log4j.core.appender.SMTPAppender.isFiltered(SMTPAppender.java:157)
      [java] at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:94)
      [java] at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfig.asyncCallAppenders(AsyncLoggerConfig.java:116)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigHelper.java:218)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigHelper.java:203)
      [java] at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:133)
      [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      [java] at java.lang.Thread.run(Thread.java:695)
      [java] Exception in thread "AsyncLoggerConfig-1" java.lang.RuntimeException: java.lang.NullPointerException
      [java] at com.lmax.disruptor.FatalExceptionHandler.handleEventException(FatalExceptionHandler.java:45)
      [java] at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:152)
      [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      [java] at java.lang.Thread.run(Thread.java:695)
      [java] Caused by: java.lang.NullPointerException
      [java] at org.apache.logging.log4j.core.filter.ThresholdFilter.filter(ThresholdFilter.java:70)
      [java] at org.apache.logging.log4j.core.filter.ThresholdFilter.filter(ThresholdFilter.java:66)
      [java] at org.apache.logging.log4j.core.filter.AbstractFilterable.isFiltered(AbstractFilterable.java:124)
      [java] at org.apache.logging.log4j.core.appender.SMTPAppender.isFiltered(SMTPAppender.java:157)
      [java] at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:94)
      [java] at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfig.asyncCallAppenders(AsyncLoggerConfig.java:116)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigHelper.java:218)
      [java] at org.apache.logging.log4j.core.async.AsyncLoggerConfigHelper$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigHelper.java:203)
      [java] at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:133)

        Issue Links

          Activity

          Remko Popma made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Remko Popma [ remkop@yahoo.com ]
          Fix Version/s 2.0-rc1 [ 12325011 ]
          Fix Version/s 2.0 [ 12324757 ]
          Resolution Fixed [ 1 ]
          Hide
          Remko Popma added a comment -

          Log4jLogEvent constructor and RingBufferLogEvent.getLevel now convert null Level to Level.OFF to prevent NPEs.

          Fixed in revision 1555339.
          Please verify and close.

          Show
          Remko Popma added a comment - Log4jLogEvent constructor and RingBufferLogEvent.getLevel now convert null Level to Level.OFF to prevent NPEs. Fixed in revision 1555339. Please verify and close.
          Remko Popma made changes -
          Field Original Value New Value
          Link This issue is related to LOG4J2-462 [ LOG4J2-462 ]
          Hide
          Daisuke Baba added a comment -

          I just copied and pasted the snippet shown in this page.
          So there was nothing strange, I think.

          <?xml version="1.0" encoding="UTF-8"?>
          <Configuration status="WARN">
            <Appenders>
              <Console name="STDOUT" target="SYSTEM_OUT">
                <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
              </Console>
                    :
          

          Please refer to my comment on another ticket as well. The symptom
          I guess the both issues seem to come from the same cause.

          Show
          Daisuke Baba added a comment - I just copied and pasted the snippet shown in this page . So there was nothing strange, I think. <?xml version= "1.0" encoding= "UTF-8" ?> <Configuration status= "WARN" > <Appenders> <Console name= "STDOUT" target= "SYSTEM_OUT" > <ThresholdFilter level= "INFO" onMatch= "ACCEPT" onMismatch= "DENY" /> </Console> : Please refer to my comment on another ticket as well. The symptom I guess the both issues seem to come from the same cause.
          Hide
          Remko Popma added a comment -

          Thanks for reporting this!
          Can you also post your configuration file to help us try to reproduce the issue?

          Show
          Remko Popma added a comment - Thanks for reporting this! Can you also post your configuration file to help us try to reproduce the issue?
          Daisuke Baba created issue -

            People

            • Assignee:
              Remko Popma
              Reporter:
              Daisuke Baba
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development