Inheritance diagram for WriterAppender:
Public Member Functions | |
WriterAppender () | |
WriterAppender (const LayoutPtr &layout, ostream *os) | |
void | setImmediateFlush (bool value) |
bool | getImmediateFlush () const |
virtual void | append (const spi::LoggingEventPtr &event) |
virtual void | close () |
virtual bool | requiresLayout () const |
Protected Member Functions | |
virtual bool | checkEntryConditions () const |
virtual void | closeWriter ()=0 |
virtual void | subAppend (const spi::LoggingEventPtr &event) |
virtual void | reset () |
virtual void | writeFooter () |
virtual void | writeHeader () |
Protected Attributes | |
bool | immediateFlush |
String | encoding |
ostream * | os |
|
This default constructor does nothing. |
|
Instantiate a WriterAppender and set the output destination to |
|
This method is called by the AppenderSkeleton::doAppend method.
If the output stream exists and is writable then write a log statement to the output stream. Otherwise, write a single warning message to The format of the output will depend on this appender's layout. Implements AppenderSkeleton. |
|
This method determines if there is a sense in attempting to append.
It checks whether there is a set output target and also if there is a set layout. If these checks fail, then the boolean value |
|
Close this appender instance. The underlying stream or writer is also closed. Closed appenders cannot be reused. Implements Appender. |
|
Close the underlying output stream. Implemented in ConsoleAppender, and FileAppender. |
|
Returns value of the ImmediateFlush option. |
|
The WriterAppender requires a layout. Hence, this method returns Implements Appender. |
|
Clear internal references to the writer and other variables. Subclasses can override this method for an alternate closing behavior. |
|
If the ImmediateFlush option is set to Avoiding the flush operation at the end of each append results in a performance gain of 10 to 20 percent. However, there is safety tradeoff involved in skipping flushing. Indeed, when flushing is skipped, then it is likely that the last few log events will not be recorded on disk when the application exits. This is a high price to pay even for a 20% performance gain. |
|
Actual writing occurs here.
Most subclasses of Reimplemented in DailyRollingFileAppender, and RollingFileAppender. |
|
Write a footer as produced by the embedded layout's Layout::appendFooter method. |
|
Write a header as produced by the embedded layout's Layout::appendHeader method. |
|
The encoding to use when opening an input stream.
The |
|
Immediate flush means that the underlying writer or output stream will be flushed at the end of each append operation. Immediate flush is slower but ensures that each append request is actually written. If
The |
|
This is the output stream where we will write to. |