|
Apache Log4cxx
Version 2.0.0
|
Implementation base class for all appenders. More...
#include <appenderskeleton.h>
Public Member Functions | |
| AppenderSkeleton (const LayoutPtr &layout={}) | |
| virtual | ~AppenderSkeleton () |
| void | activateOptions () override |
| Activate the options that were previously set with calls to option setters. | |
| void | setOption (const LogString &option, const LogString &value) override |
Override this method to set option to value. | |
| void | addFilter (const spi::FilterPtr &newFilter) override |
Add newFilter to end of the spi::Filter chain. | |
| void | clearFilters () override |
| Clear the spi::Filter chain. | |
| void | close () override |
| Release any resources allocated within the appender such as file handles, network connections, etc. | |
| const spi::ErrorHandlerPtr | getErrorHandler () const |
| The currently set spi::ErrorHandler for this Appender. | |
| spi::FilterPtr | getFilter () const override |
| The first spi::Filter in the filter chain for this Appender. | |
| const spi::FilterPtr | getFirstFilter () const |
| The first spi::Filter in the filter chain for this Appender. | |
| LayoutPtr | getLayout () const override |
| The currently set Layout for this appender. | |
| LogString | getName () const override |
| The name of this Appender. | |
| const LevelPtr | getThreshold () const |
| This appender's current threshold level. | |
| bool | isAsSevereAsThreshold (const LevelPtr &level) const |
Is level greater than or equal to this appender's threshold? | |
| void | doAppend (const spi::LoggingEventPtr &event) override |
| Call doAppendImpl after acquiring a lock that prevents other threads from concurrently executing doAppendImpl. | |
| void | setErrorHandler (const spi::ErrorHandlerPtr &newValue) |
Use newValue as the spi::ErrorHandler for this Appender. | |
| void | setLayout (const LayoutPtr &newValue) override |
Use newValue as the layout for this appender. | |
| void | setName (const LogString &newValue) override |
Use newValue for the name of this Appender. | |
| void | setThreshold (const LevelPtr &newValue) |
Use newValue as this appender's threshold level. | |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::Appender | |
| virtual | ~Appender () |
| void | doAppend (const spi::LoggingEventPtr &event, helpers::Pool &pool) |
| virtual bool | requiresLayout () const |
| Public Member Functions inherited from log4cxx::spi::OptionHandler | |
| virtual | ~OptionHandler () |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::helpers::Object | |
| virtual | ~Object () |
| virtual const helpers::Class & | getClass () const =0 |
| virtual bool | instanceof (const Class &clazz) const =0 |
| virtual const void * | cast (const Class &clazz) const =0 |
Protected Member Functions | |
| AppenderSkeleton (LOG4CXX_PRIVATE_PTR(AppenderSkeletonPrivate) priv) | |
| virtual void | append (const spi::LoggingEventPtr &event)=0 |
Subclasses of AppenderSkeleton must implement this method to perform actual logging. | |
| void | doAppendImpl (const spi::LoggingEventPtr &event) |
Call the AppenderSkeleton::append method if the level of event is not lower than this appender's threshold and no attached spi::Filter indicates event is rejected. | |
| bool | isAccepted (const spi::LoggingEventPtr &event) const |
Does no attached filter deny event or does an attached filter accept event? | |
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.
|
protected |
| log4cxx::AppenderSkeleton::AppenderSkeleton | ( | const LayoutPtr & | layout = {} | ) |
|
virtual |
|
overridevirtual |
Activate the options that were previously set with calls to option setters.
No action is performed in this implementation.
Implements log4cxx::spi::OptionHandler.
Reimplemented in log4cxx::ConsoleAppender, log4cxx::db::DBAppender, log4cxx::db::ODBCAppender, log4cxx::FileAppender, log4cxx::net::SMTPAppender, log4cxx::net::SocketAppenderSkeleton, log4cxx::net::TelnetAppender, log4cxx::nt::NTEventLogAppender, log4cxx::rolling::MultiprocessRollingFileAppender, log4cxx::rolling::RollingFileAppender, and log4cxx::WriterAppender.
|
overridevirtual |
Add newFilter to end of the spi::Filter chain.
Implements log4cxx::Appender.
|
protectedpure virtual |
Subclasses of AppenderSkeleton must implement this method to perform actual logging.
See also AppenderSkeleton::doAppend method.
Implemented in log4cxx::AsyncAppender, log4cxx::db::DBAppender, log4cxx::db::ODBCAppender, log4cxx::net::SMTPAppender, log4cxx::net::SocketAppenderSkeleton, log4cxx::net::SyslogAppender, log4cxx::net::TelnetAppender, log4cxx::nt::NTEventLogAppender, log4cxx::nt::OutputDebugStringAppender, and log4cxx::WriterAppender.
|
overridevirtual |
Clear the spi::Filter chain.
Implements log4cxx::Appender.
|
overridevirtual |
Release any resources allocated within the appender such as file handles, network connections, etc.
Calling doAppend() on a closed appender generates one warning on stderr.
Implements log4cxx::Appender.
|
overridevirtual |
Call doAppendImpl after acquiring a lock that prevents other threads from concurrently executing doAppendImpl.
Reimplement this method in your appender if you use a different concurrency control technique.
Implements log4cxx::Appender.
Reimplemented in log4cxx::AsyncAppender.
|
protected |
Call the AppenderSkeleton::append method if the level of event is not lower than this appender's threshold and no attached spi::Filter indicates event is rejected.
| const spi::ErrorHandlerPtr log4cxx::AppenderSkeleton::getErrorHandler | ( | ) | const |
The currently set spi::ErrorHandler for this Appender.
|
overridevirtual |
The first spi::Filter in the filter chain for this Appender.
Implements log4cxx::Appender.
| const spi::FilterPtr log4cxx::AppenderSkeleton::getFirstFilter | ( | ) | const |
The first spi::Filter in the filter chain for this Appender.
|
overridevirtual |
The currently set Layout for this appender.
Implements log4cxx::Appender.
|
overridevirtual |
The name of this Appender.
Implements log4cxx::Appender.
| const LevelPtr log4cxx::AppenderSkeleton::getThreshold | ( | ) | const |
This appender's current threshold level.
See the setThreshold method for the meaning of this option.
|
protected |
Does no attached filter deny event or does an attached filter accept event?
| bool log4cxx::AppenderSkeleton::isAsSevereAsThreshold | ( | const LevelPtr & | level | ) | const |
Is level greater than or equal to this appender's threshold?
| void log4cxx::AppenderSkeleton::setErrorHandler | ( | const spi::ErrorHandlerPtr & | newValue | ) |
Use newValue as the spi::ErrorHandler for this Appender.
|
overridevirtual |
Use newValue as the layout for this appender.
Note that some appenders have their own (fixed) layouts sor do not need one.
Implements log4cxx::Appender.
|
overridevirtual |
Use newValue for the name of this Appender.
Implements log4cxx::Appender.
|
overridevirtual |
Override this method to set option to value.
| Supported options | Supported values | Default value |
|---|---|---|
| Name | {any} | - |
| Threshold | Trace,Debug,Info,Warn,Error,Fatal,Off,All | All |
Reimplemented from log4cxx::spi::OptionHandler.
Reimplemented in log4cxx::AsyncAppender, log4cxx::ConsoleAppender, log4cxx::db::DBAppender, log4cxx::db::ODBCAppender, log4cxx::FileAppender, log4cxx::net::SMTPAppender, log4cxx::net::SocketAppenderSkeleton, log4cxx::net::SyslogAppender, log4cxx::net::TelnetAppender, log4cxx::nt::NTEventLogAppender, log4cxx::rolling::RollingFileAppender, and log4cxx::WriterAppender.
| void log4cxx::AppenderSkeleton::setThreshold | ( | const LevelPtr & | newValue | ) |
Use newValue as this appender's threshold level.
All log events with lower level than the appender's 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.
The default level is "ALL", the lowest possible level, meaning no event is blocked by this threshold.