org.apache.log4j.filter

## 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
  Author:
    Scott Deboy sdeboy@apache.org

- - ### Field Summary

    - ### Fields inherited from class org.apache.log4j.spi.Filter

      `ACCEPT, DENY, NEUTRAL, next`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LocationInfoFilter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activateOptions()`
    `int` | `decide(org.apache.log4j.spi.LoggingEvent event)` If this event does not already contain location information, evaluate the event against the expression.
    `boolean` | `getConvertInFixToPostFix()` Set whether in-fix expressions should be converted to post-fix.
    `String` | `getExpression()` Get expression.
    `void` | `setConvertInFixToPostFix(boolean newValue)` Set whether in-fix expressions should be converted to post-fix.
    `void` | `setExpression(String exp)` Set expression.

    - ### 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

    - #### LocationInfoFilter

          public LocationInfoFilter()

  - ### Method Detail

    - #### activateOptions

          public void activateOptions()

      Specified by:
        `activateOptions` in interface `org.apache.log4j.spi.OptionHandler`
      Overrides:
        `activateOptions` in class `org.apache.log4j.spi.Filter`

    - #### setExpression

          public void setExpression(String exp)

      Set expression.
      Parameters:
        `exp` - expression.

    - #### getExpression

          public String getExpression()

      Get expression.
      Returns:
        expression.

    - #### 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:
        `decide` in class `org.apache.log4j.spi.Filter`
      Parameters:
        `event` - event
      Returns:
        Filter.NEUTRAL.

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.