[logback-dev] [Bug 17] New: c.q.l.c.filter.EvaluatorFilter should not barf with NPE

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Wed Oct 25 22:18:27 CEST 2006


http://bugzilla.qos.ch/show_bug.cgi?id=17

           Summary: c.q.l.c.filter.EvaluatorFilter should not barf with NPE
           Product: logback-classic
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Other
        AssignedTo: logback-dev at qos.ch
        ReportedBy: ceki at qos.ch


In case the evaluator could not be set for c.q.l.c.filter.EvaluatorFilter, it
should NOT barf with a NPE.

LOGBACK: No context given for ch.qos.logback.core.util.PropertySetter at 176c74b
|-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Ignoring
debug attribute.
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to
instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as
[STDOUT]
|-ERROR in ch.qos.logback.core.filter.EvaluatorFilter at e5855a - No evaluator set
for filter myFilter
|-INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender
named [STDOUT] from the object stack
|-INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set to
DEBUG
|-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching
appender named [STDOUT to Logger[root]
Exception in thread "main" java.lang.NullPointerException
        at
ch.qos.logback.core.filter.EvaluatorFilter.decide(EvaluatorFilter.java:34)
        at
ch.qos.logback.core.spi.FilterAttachableImpl.getFilterChainDecision(FilterAttachableImpl.java:68)
        at
ch.qos.logback.core.AppenderBase.getFilterChainDecision(AppenderBase.java:115)
        at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:65)
        at
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:51)
        at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:286)
        at ch.qos.logback.classic.Logger.callAppenders(Logger.java:270)
        at ch.qos.logback.classic.Logger.filterAndLog(Logger.java:375)
        at ch.qos.logback.classic.Logger.debug(Logger.java:398)
        at chapter5.GoMDC.main(GoMDC.java:28)

Config file:

<configuration>

  <appender name="STDOUT"
    class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
      <param name="Pattern"
        value="%-4relative [%thread] %-5level %X{testKey} - %msg%n" />
    </layout>
    <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
      <Name>myFilter</Name>
      <Evaluator class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
        <Expression>"k".equals(mdc.get("k"))</Expression>
      </Evaluator>
    </filter>
  </appender>



public class EvaluatorFilter
  <root>
    <level value="debug" />
    <appender-ref ref="STDOUT" />
  </root>
</configuration>


-- 
Configure bugmail: http://bugzilla.qos.ch/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the logback-dev mailing list