 |
log4cplus
2.0.5
|
Go to the documentation of this file.
24 #ifndef LOG4CPLUS_APPENDER_HEADER_
25 #define LOG4CPLUS_APPENDER_HEADER_
29 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
43 #include <condition_variable>
320 #if ! defined (LOG4CPLUS_SINGLE_THREADED)
330 #if ! defined (LOG4CPLUS_SINGLE_THREADED)
331 void subtract_in_flight();
340 #endif // LOG4CPLUS_APPENDER_HEADER_
bool useLockFile
Use lock file for inter-process synchronization of access to log file.
bool closed
Is this appender closed?
std::basic_string< tchar > tstring
bool async
Asynchronous append.
virtual ErrorHandler * getErrorHandler()
Return the currently set ErrorHandler for this Appender.
Appender(const log4cplus::helpers::Properties &properties)
bool isAsSevereAsThreshold(LogLevel ll) const
Check whether the message LogLevel is below the appender's threshold.
std::atomic< std::size_t > in_flight
void asyncDoAppend(const log4cplus::spi::InternalLoggingEvent &event)
This method performs book keeping related to asynchronous logging and executes syncDoAppend() to do t...
void setFilter(log4cplus::spi::FilterPtr f)
Set the filter chain on this Appender.
bool isClosed() const
Check if this appender is in closed state.
virtual void close()=0
Release any resources allocated within the appender such as file handles, network connections,...
void syncDoAppend(const log4cplus::spi::InternalLoggingEvent &event)
This method performs threshold checks and invokes filters before delegating actual logging to the sub...
This class is used to "handle" errors encountered in an {}.
LogLevel getThreshold() const
Returns this appenders threshold LogLevel.
log4cplus::spi::FilterPtr getFilter() const
Get the filter chain on this Appender.
helpers::SharedObjectPtr< Appender > SharedAppenderPtr
This is a pointer to an Appender.
virtual void setLayout(std::unique_ptr< Layout > layout)
Set the layout for this appender.
void destructorImpl()
This function is for derived appenders to call from their destructors.
LogLevel threshold
There is no LogLevel threshold filtering by default.
void doAppend(const log4cplus::spi::InternalLoggingEvent &event)
This function checks async flag.
std::mutex in_flight_mutex
void waitToFinishAsyncLogging()
This method waits for all events that are being asynchronously logged to finish.
std::unique_ptr< Layout > layout
The layout variable does not need to be set if the appender implementation has its own layout.
const LogLevel NOT_SET_LOG_LEVEL
This class is used to layout strings sent to an {}.
virtual void error(const log4cplus::tstring &err)
virtual log4cplus::tstring getName()
Get the name of this appender.
void setThreshold(LogLevel th)
Set the threshold LogLevel.
virtual Layout * getLayout()
Returns the layout of this appender.
void addFilter(std::function< spi::FilterResult(const log4cplus::spi::InternalLoggingEvent &)>)
Add filter at the end of the filters chain.
The internal representation of logging events.
void addFilter(log4cplus::spi::FilterPtr f)
Add filter at the end of the filters chain.
virtual void setErrorHandler(std::unique_ptr< ErrorHandler > eh)
Set the ErrorHandler for this Appender.
virtual ~ErrorHandler()=0
std::unique_ptr< helpers::LockFile > lockFile
Optional system wide synchronization lock.
virtual ~OnlyOnceErrorHandler()
std::condition_variable in_flight_condition
std::unique_ptr< ErrorHandler > errorHandler
It is assumed and enforced that errorHandler is never null.
log4cplus::tstring name
Appenders are named.
virtual void setName(const log4cplus::tstring &name)
Set the name of this appender.
Extend this class for implementing your own strategies for printing log statements.
virtual void error(const log4cplus::tstring &err)=0
virtual void append(const log4cplus::spi::InternalLoggingEvent &event)=0
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::spi::FilterPtr filter
The first filter in the filter chain.
tstring & formatEvent(const log4cplus::spi::InternalLoggingEvent &event) const