org.apache.log4j.varia
Class LocationInfoFilter
java.lang.Object
|
+--org.apache.log4j.spi.Filter
|
+--org.apache.log4j.varia.LocationInfoFilter
- All Implemented Interfaces:
- OptionHandler
- public class LocationInfoFilter
- extends 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
- Author:
- Scott Deboy sdeboy@apache.org
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocationInfoFilter
public LocationInfoFilter()
activateOptions
public void activateOptions()
- Description copied from class:
Filter
- Usually filters options become active when set. We provide a
default do-nothing implementation for convenience.
- Specified by:
activateOptions
in interface OptionHandler
- Overrides:
activateOptions
in class Filter
setExpression
public void setExpression(java.lang.String expression)
getExpression
public java.lang.String getExpression()
setConvertInFixToPostFix
public void setConvertInFixToPostFix(boolean convertInFixToPostFix)
getConvertInFixToPostFix
public boolean getConvertInFixToPostFix()
decide
public int decide(LoggingEvent event)
- If this event does not already contain location information,
evaluate the event against the expression.
If the expression evaluates to true, generate a LocationInfo instance
by creating an exception and set this LocationInfo on the event.
Returns
Filter.NEUTRAL
- Specified by:
decide
in class Filter
- Parameters:
event
- The LoggingEvent to decide upon.
Copyright 2000-2003 Apache Software Foundation.