Apache log4cxx  Version 0.12.0
log4cxx::filter::LocationInfoFilter Class Reference

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. More...

#include <locationinfofilter.h>

Inheritance diagram for log4cxx::filter::LocationInfoFilter:
log4cxx::spi::Filter log4cxx::spi::OptionHandler log4cxx::helpers::Object log4cxx::helpers::Object

Public Member Functions

 LocationInfoFilter ()
 
void activateOptions (log4cxx::helpers::Pool &)
 Activate the options that were previously set with calls to option setters. More...
 
void setExpression (const LogString &expression)
 
LogString getExpression () const
 
void setConvertInFixToPostFix (bool convertInFixToPostFix)
 
bool getConvertInFixToPostFix () const
 
FilterDecision decide (const spi::LoggingEventPtr &event) const
 If this event does not already contain location information, evaluate the event against the expression. More...
 
- Public Member Functions inherited from log4cxx::spi::Filter
 Filter ()
 
log4cxx::spi::FilterPtr getNext () const
 
void setNext (const log4cxx::spi::FilterPtr &newNext)
 
void activateOptions (log4cxx::helpers::Pool &p)
 Usually filters options become active when set. More...
 
void setOption (const LogString &option, const LogString &value)
 Set option to value. More...
 
- Public Member Functions inherited from log4cxx::spi::OptionHandler
virtual ~OptionHandler ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Additional Inherited Members

- Public Types inherited from log4cxx::spi::Filter
enum  FilterDecision { DENY = -1, NEUTRAL = 0, ACCEPT = 1 }
 

Detailed Description

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

Constructor & Destructor Documentation

◆ LocationInfoFilter()

log4cxx::filter::LocationInfoFilter::LocationInfoFilter ( )

Member Function Documentation

◆ activateOptions()

void log4cxx::filter::LocationInfoFilter::activateOptions ( log4cxx::helpers::Pool p)
virtual

Activate the options that were previously set with calls to option setters.

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

Implements log4cxx::spi::OptionHandler.

◆ decide()

FilterDecision log4cxx::filter::LocationInfoFilter::decide ( const spi::LoggingEventPtr event) const
virtual

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 log4cxx::spi::Filter#NEUTRAL

Implements log4cxx::spi::Filter.

◆ getConvertInFixToPostFix()

bool log4cxx::filter::LocationInfoFilter::getConvertInFixToPostFix ( ) const

◆ getExpression()

LogString log4cxx::filter::LocationInfoFilter::getExpression ( ) const

◆ setConvertInFixToPostFix()

void log4cxx::filter::LocationInfoFilter::setConvertInFixToPostFix ( bool  convertInFixToPostFix)

◆ setExpression()

void log4cxx::filter::LocationInfoFilter::setExpression ( const LogString expression)

The documentation for this class was generated from the following file: