Class LocationInfoFilter
java.lang.Object
org.apache.log4j.spi.Filter
org.apache.log4j.filter.LocationInfoFilter
- All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler
public class LocationInfoFilter
extends org.apache.log4j.spi.Filter
Location information is usually specified at the appender level -
all events associated
with an appender either create and parse stack traces or they do not.
This is an expensive operation and in some cases not needed
for all events associated with an appender.
This filter creates event-level location information only
if the provided expression evaluates to true.
For information on expression syntax,
see org.apache.log4j.rule.ExpressionRule
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanConvert to in-fix to post-fix.(package private) StringExpression.(package private) RuleCompiled expression.Fields inherited from class org.apache.log4j.spi.Filter
ACCEPT, DENY, NEUTRAL, next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintdecide(org.apache.log4j.spi.LoggingEvent event) If this event does not already contain location information, evaluate the event against the expression.booleanSet whether in-fix expressions should be converted to post-fix.Get expression.voidsetConvertInFixToPostFix(boolean newValue) Set whether in-fix expressions should be converted to post-fix.voidsetExpression(String exp) Set expression.Methods inherited from class org.apache.log4j.spi.Filter
getNext, setNext
-
Field Details
-
Constructor Details
-
LocationInfoFilter
public LocationInfoFilter()
-
-
Method Details
-
activateOptions
public void activateOptions()- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler- Overrides:
activateOptionsin classorg.apache.log4j.spi.Filter
-
setExpression
-
getExpression
-
setConvertInFixToPostFix
public void setConvertInFixToPostFix(boolean newValue) Set whether in-fix expressions should be converted to post-fix.- Parameters:
newValue- if true, convert/
-
getConvertInFixToPostFix
public boolean getConvertInFixToPostFix()Set whether in-fix expressions should be converted to post-fix.- Returns:
- if true, expressions are converted.
-
decide
public int decide(org.apache.log4j.spi.LoggingEvent event) If this event does not already contain location information, evaluate the event against the expression. If the expression evaluates to true, force generation of location information by calling getLocationInfo.- Specified by:
decidein classorg.apache.log4j.spi.Filter- Parameters:
event- event- Returns:
- Filter.NEUTRAL.
-