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

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Tue Nov 10 22:18:44 CET 2009

     [ http://jira.qos.ch/browse/LBCORE-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu resolved LBCORE-118.

    Resolution: Won't Fix

The present behavior is deemed correct. Nevertheless, the documentation has been modified mentioning that the "marker" variable can be null and that it is the user's responsibility to check for this condition in order to avoid NullPointerExceptions,

> 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: Ceki Gulcu
>            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