public class ExpressionFilter
extends org.apache.log4j.spi.Filter
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.| Constructor and Description |
|---|
ExpressionFilter() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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(String exp)
Set exp.
|
public void activateOptions()
activateOptions in interface org.apache.log4j.spi.OptionHandleractivateOptions in class org.apache.log4j.spi.Filterpublic void setExpression(String exp)
exp - exp.public 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.Filterevent - logging event;Filter.NEUTRAL is there is no string match.Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0
Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.