Log4j 1.3alpha-5

org.apache.log4j.filter
Class LocationInfoFilter

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.spi.Filter
              |
              +--org.apache.log4j.filter.LocationInfoFilter
All Implemented Interfaces:
Component, 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

Field Summary
 
Fields inherited from class org.apache.log4j.spi.Filter
ACCEPT, DENY, NEUTRAL
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
LocationInfoFilter()
           
 
Method Summary
 void activateOptions()
          Usually filters options become active when set.
 int decide(LoggingEvent event)
          If this event does not already contain location information, evaluate the event against the expression.
 boolean getConvertInFixToPostFix()
           
 java.lang.String getExpression()
           
 void setConvertInFixToPostFix(boolean convertInFixToPostFix)
           
 void setExpression(java.lang.String expression)
           
 
Methods inherited from class org.apache.log4j.spi.Filter
getNext, setNext
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, setLoggerRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationInfoFilter

public LocationInfoFilter()
Method Detail

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.

Log4j 1.3alpha-5

Copyright 2000-2005 Apache Software Foundation.