|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.spi.Filter
org.apache.log4j.filter.ExpressionFilter
public class ExpressionFilter
A filter supporting complex expressions - supports both infix and postfix expressions (infix expressions must first be converted to postfix prior to processing).
See org.apache.log4j.chainsaw.LoggingEventFieldResolver.java
for the correct names for logging event fields
used when building expressions.
See org.apache.log4j.chainsaw.rule
package
for a list of available
rules which can be applied using the expression syntax.
See org.apache.log4j.chainsaw.RuleFactory
for the symbols
used to activate the corresponding rules.
LoggingEvent
and AcceptOnMatch is true,
the decide(org.apache.log4j.spi.LoggingEvent)
method returns Filter.ACCEPT
.
If there is a match between the value of the
Expression option and the LoggingEvent
and AcceptOnMatch is false,
Filter.DENY
is returned.
If there is no match, Filter.NEUTRAL
is returned.
Field Summary |
---|
Fields inherited from class org.apache.log4j.spi.Filter |
---|
ACCEPT, DENY, NEUTRAL, next |
Constructor Summary | |
---|---|
ExpressionFilter()
|
Method Summary | |
---|---|
void |
activateOptions()
|
int |
decide(org.apache.log4j.spi.LoggingEvent event)
Determines if event matches the filter. |
boolean |
getAcceptOnMatch()
Gets whether filter accepts matching or non-matching events. |
boolean |
getConvertInFixToPostFix()
Get in-fix to post-fix conversion setting. |
java.lang.String |
getExpression()
Get expression. |
void |
setAcceptOnMatch(boolean newValue)
Set whether filter should accept events if they match the expression. |
void |
setConvertInFixToPostFix(boolean newValue)
Set convert in-fix to post-fix. |
void |
setExpression(java.lang.String exp)
Set exp. |
Methods inherited from class org.apache.log4j.spi.Filter |
---|
getNext, setNext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionFilter()
Method Detail |
---|
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
activateOptions
in class org.apache.log4j.spi.Filter
public void setExpression(java.lang.String exp)
exp
- exp.public java.lang.String getExpression()
public void setConvertInFixToPostFix(boolean newValue)
newValue
- new value.public boolean getConvertInFixToPostFix()
public void setAcceptOnMatch(boolean newValue)
newValue
- if true, accept on match.public boolean getAcceptOnMatch()
public int decide(org.apache.log4j.spi.LoggingEvent event)
decide
in class org.apache.log4j.spi.Filter
event
- logging event;
Filter.NEUTRAL
is there is no string match.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010 The Apache Software Foundation. Licensed under the Apache License, Version 2.0
Apache Extras Companion for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.