Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-63

EvaluatorFilter returns OnMatch when marker is null

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None
    • Windows XP

    Description

      <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 && marker.getName().equals("Alert")</expression>

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            manuel Manuel Kueblboeck
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: