[logback-dev] [JIRA] Created: (LBCORE-118) EvaluatorFilter returns OnMatch when marker is null

Manuel Kueblboeck (JIRA) noreply-jira at qos.ch
Tue Sep 1 21:49:36 CEST 2009


EvaluatorFilter returns OnMatch when marker is null
---------------------------------------------------

                 Key: LBCORE-118
                 URL: http://jira.qos.ch/browse/LBCORE-118
             Project: logback-core
          Issue Type: Bug
          Components: Other
    Affects Versions: 0.9.17
         Environment: Windows XP
            Reporter: Manuel Kueblboeck
            Assignee: Logback dev list
            Priority: Minor


<appender name="Alert" class="ch.qos.logback.core.ConsoleAppender">
    <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
      <evaluator name="isAlert">
        <expression>marker.getName().equals("Alert")</expression>
      </evaluator>
      <OnMatch>ACCEPT</OnMatch>
      <OnMismatch>DENY</OnMismatch>
    </filter>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>ALERT: %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
    </layout>
</appender>

In the above example, when an event is logged without an attached marker, the filter returns OnMatch. I would expect that it returns OnMismatch.

A work around for this issue is to change the expression to this:
<expression>marker != null &amp;&amp; marker.getName().equals("Alert")</expression>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list