Apache log4cxx
Version 0.10.0
|
Implementation base class for all appenders. More...
Public Member Functions | |
AppenderSkeleton () | |
AppenderSkeleton (const LayoutPtr &layout) | |
void | addRef () const |
void | releaseRef () const |
void | finalize () |
Finalize this appender by calling the derived class' close method. More... | |
virtual void | activateOptions (log4cxx::helpers::Pool &) |
Derived appenders should override this method if option structure requires it. More... | |
virtual void | setOption (const LogString &option, const LogString &value) |
Set option to value . More... | |
void | addFilter (const spi::FilterPtr &newFilter) |
Add a filter to end of the filter list. More... | |
void | clearFilters () |
Clear the filters chain. More... | |
const spi::ErrorHandlerPtr & | getErrorHandler () const |
Return the currently set spi::ErrorHandler for this Appender. More... | |
spi::FilterPtr | getFilter () const |
Returns the head Filter. More... | |
const spi::FilterPtr & | getFirstFilter () const |
Return the first filter in the filter chain for this Appender. More... | |
LayoutPtr | getLayout () const |
Returns the layout of this appender. More... | |
LogString | getName () const |
Returns the name of this Appender. More... | |
const LevelPtr & | getThreshold () |
Returns this appenders threshold level. More... | |
bool | isAsSevereAsThreshold (const LevelPtr &level) const |
Check whether the message level is below the appender's threshold. More... | |
void | doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) |
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method. More... | |
void | setErrorHandler (const spi::ErrorHandlerPtr &eh) |
Set the ErrorHandler for this Appender. More... | |
void | setLayout (const LayoutPtr &layout1) |
Set the layout for this appender. More... | |
void | setName (const LogString &name1) |
Set the name of this Appender. More... | |
void | setThreshold (const LevelPtr &threshold) |
Set the threshold level. More... | |
Public Member Functions inherited from Appender | |
virtual | ~Appender () |
virtual void | close ()=0 |
Release any resources allocated within the appender such as file handles, network connections, etc. More... | |
virtual bool | requiresLayout () const =0 |
Configurators call this method to determine if the appender requires a layout. More... | |
Public Member Functions inherited from OptionHandler | |
virtual | ~OptionHandler () |
Public Member Functions inherited from Object | |
virtual const helpers::Class & | getClass () const |
virtual | ~Object () |
virtual bool | instanceof (const Class &clazz) const =0 |
virtual const void * | cast (const Class &clazz) const =0 |
Public Member Functions inherited from ObjectImpl | |
ObjectImpl () | |
virtual | ~ObjectImpl () |
void | addRef () const |
void | releaseRef () const |
Protected Member Functions | |
virtual void | append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)=0 |
Subclasses of AppenderSkeleton should implement this method to perform actual logging. More... | |
Protected Attributes | |
LayoutPtr | layout |
The layout variable does not need to be set if the appender implementation has its own layout. More... | |
LogString | name |
Appenders are named. More... | |
LevelPtr | threshold |
There is no level threshold filtering by default. More... | |
spi::ErrorHandlerPtr | errorHandler |
It is assumed and enforced that errorHandler is never null. More... | |
spi::FilterPtr | headFilter |
The first filter in the filter chain. More... | |
spi::FilterPtr | tailFilter |
The last filter in the filter chain. More... | |
bool | closed |
Is this appender closed? More... | |
log4cxx::helpers::Pool | pool |
log4cxx::helpers::Mutex | mutex |
Protected Attributes inherited from ObjectImpl | |
unsigned int volatile | ref |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
static const helpers::Class & | getStaticClass () |
static const log4cxx::helpers::ClassRegistration & | registerClass () |
Implementation base class for all appenders.
This class provides the code for common functionality, such as support for threshold filtering and support for general filters.
AppenderSkeleton | ( | ) |
AppenderSkeleton | ( | const LayoutPtr & | layout | ) |
|
inlinevirtual |
Derived appenders should override this method if option structure requires it.
Implements OptionHandler.
Reimplemented in DailyRollingFileAppender, ODBCAppender, FileAppender, SocketHubAppender, RollingFileAppender, SMTPAppender, TelnetAppender, WriterAppender, SyslogAppender, SocketAppenderSkeleton, RollingFileAppenderSkeleton, ConsoleAppender, and NTEventLogAppender.
|
virtual |
Add a filter to end of the filter list.
Implements Appender.
|
virtual |
Implements Object.
Reimplemented in AsyncAppender.
|
protectedpure virtual |
Subclasses of AppenderSkeleton
should implement this method to perform actual logging.
See also AppenderSkeleton::doAppend method.
Implemented in ODBCAppender, SocketHubAppender, XMLSocketAppender, SocketAppender, WriterAppender, TelnetAppender, SMTPAppender, AsyncAppender, NTEventLogAppender, SyslogAppender, and OutputDebugStringAppender.
|
virtual |
Clear the filters chain.
Implements Appender.
|
virtual |
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method.
Implements Appender.
void finalize | ( | ) |
Finalize this appender by calling the derived class' close
method.
|
inline |
Return the currently set spi::ErrorHandler for this Appender.
|
inlinevirtual |
Returns the head Filter.
Implements Appender.
|
inline |
Return the first filter in the filter chain for this Appender.
The return value may be 0
if no is filter is set.
|
inlinevirtual |
|
inline |
Returns this appenders threshold level.
See the setThreshold method for the meaning of this option.
bool isAsSevereAsThreshold | ( | const LevelPtr & | level | ) | const |
Check whether the message level is below the appender's threshold.
If there is no threshold set, then the return value is always true
.
|
virtual |
Implements Object.
Reimplemented in AsyncAppender.
void setErrorHandler | ( | const spi::ErrorHandlerPtr & | eh | ) |
Set the ErrorHandler for this Appender.
|
inlinevirtual |
Set the layout for this appender.
Note that some appenders have their own (fixed) layouts or do not use one. For example, the SocketAppender ignores the layout set here.
Implements Appender.
|
inlinevirtual |
Set option
to value
.
The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.
Implements OptionHandler.
Reimplemented in DailyRollingFileAppender, AsyncAppender, WriterAppender, ODBCAppender, FileAppender, SocketAppenderSkeleton, SocketHubAppender, TelnetAppender, RollingFileAppender, SMTPAppender, SyslogAppender, ConsoleAppender, and NTEventLogAppender.
void setThreshold | ( | const LevelPtr & | threshold | ) |
Set the threshold level.
All log events with lower level than the threshold level are ignored by the appender.
In configuration files this option is specified by setting the value of the Threshold option to a level string, such as "DEBUG", "INFO" and so on.
|
protected |
Is this appender closed?
|
protected |
It is assumed and enforced that errorHandler is never null.
|
protected |
The first filter in the filter chain.
Set to null
initially.
|
protected |
The layout variable does not need to be set if the appender implementation has its own layout.
|
protected |
|
protected |
Appenders are named.
|
protected |
|
protected |
The last filter in the filter chain.
|
protected |
There is no level threshold filtering by default.