|
Apache Log4cxx
Version 2.0.0
|
A special version of the RollingFileAppender that acts properly with multiple processes. More...
#include <multiprocessrollingfileappender.h>
Public Member Functions | |
| MultiprocessRollingFileAppender () | |
| An unconfigured Appender. | |
| void | activateOptions () override |
| Derived appenders should override this method if option structure requires it. | |
| Public Member Functions inherited from log4cxx::rolling::RollingFileAppender | |
| RollingFileAppender () | |
| An unconfigured Appender. | |
| int | getMaxBackupIndex () const |
| Returns the value of the MaxBackupIndex option. | |
| size_t | getMaximumFileSize () const |
| Get the maximum size that the output file is allowed to reach before being rolled over to backup files. | |
| void | setMaxBackupIndex (int maxBackupIndex) |
| Set the maximum number of backup files to keep around. | |
| void | setMaxFileSize (const LogString &value) |
| Set the maximum size that the output file is allowed to reach before being rolled over to backup files. | |
| void | setMaximumFileSize (size_t value) |
| void | setDatePattern (const LogString &pattern) |
The DatePattern takes a string in the same format as expected by SimpleDateFormat. | |
| LogString | makeFileNamePattern (const LogString &datePattern) |
| void | setOption (const LogString &option, const LogString &value) override |
Set option to value. | |
| void | activateOptions () override |
| Derived appenders should override this method if option structure requires it. | |
| bool | rollover () |
| Implements the configured roll over behaviour. | |
| RollingPolicyPtr | getRollingPolicy () const |
| The policy that implements the scheme for rolling over a log file. | |
| TriggeringPolicyPtr | getTriggeringPolicy () const |
| The policy that determine when to trigger a log file rollover. | |
| void | setRollingPolicy (const RollingPolicyPtr &policy) |
Use policy as the scheme for rolling over log files. | |
| void | setTriggeringPolicy (const TriggeringPolicyPtr &policy) |
Use policy to determine when to trigger a log file rollover. | |
| void | close () override |
| Close appender. | |
| size_t | getFileLength () const |
| Get byte length of current active log file. | |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::FileAppender | |
| FileAppender () | |
| An unconfigured Appender. | |
| FileAppender (const LayoutPtr &layout, const LogString &fileName, bool appendToExistingFile=true, bool useBufferedOutput=false, int bufferByteCount=DefaultBufferedByteCount) | |
Open fileName and prepare to write spi::LoggingEvent messages formatted by layout. | |
| ~FileAppender () | |
| void | setFile (const LogString &file) |
| The File property takes a string value which should be the name of the file to append to. | |
| bool | getAppend () const |
| Returns the value of the Append option. | |
| LogString | getFile () const |
| Returns the value of the File option. | |
| bool | getBufferedIO () const |
| Get the value of the BufferedIO option. | |
| int | getBufferSize () const |
| Get the size of the IO buffer. | |
| int | getBufferedSeconds () const |
Get the number of seconds between file writes when the BufferedIO option is true. | |
| void | setAppend (bool newValue) |
Set file open mode to newValue. | |
| void | setBufferedIO (bool newValue) |
Set buffered output behavior to newValue. | |
| void | setBufferSize (int newValue) |
Use newValue as the size of the output buffer. | |
| void | setBufferedSeconds (int newValue) |
Flush the output buffer every newValue seconds. | |
| void | setLazyFileCreation (bool newValue) |
Create the file when the first message is written (rather than in activateOptions) if newValue is true, so that no empty file is created when nothing is logged. | |
| bool | getLazyFileCreation () const |
| Get the value of the LazyFileCreation option. | |
| Public Member Functions inherited from log4cxx::WriterAppender | |
| WriterAppender () | |
| An uninitialised Appender. | |
| ~WriterAppender () | |
| void | activateOptions () override |
| Derived appenders should override this method if option structure requires it. | |
| void | setImmediateFlush (bool value) |
If the ImmediateFlush option is set to true, the appender will flush at the end of each write. | |
| bool | getImmediateFlush () const |
| Returns value of the ImmediateFlush option. | |
| void | append (const spi::LoggingEventPtr &event) override |
| This method is called by the AppenderSkeleton::doAppend method. | |
| void | close () override |
| Close this appender instance. | |
| LogString | getEncoding () const |
| The current encoding value. | |
| void | setEncoding (const LogString &value) |
Set the encoding to value. | |
| void | setOption (const LogString &option, const LogString &value) override |
Set option to value. | |
| bool | requiresLayout () const override |
| Configurators call this method to determine if the appender requires a layout. | |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::AppenderSkeleton | |
| AppenderSkeleton () | |
| AppenderSkeleton (const LayoutPtr &layout) | |
| virtual | ~AppenderSkeleton () |
| void | addFilter (const spi::FilterPtr &newFilter) override |
| Add a filter to end of the filter list. | |
| void | clearFilters () override |
| Clear the filters chain. | |
| const spi::ErrorHandlerPtr | getErrorHandler () const |
| Return the currently set spi::ErrorHandler for this Appender. | |
| spi::FilterPtr | getFilter () const override |
| Returns the head Filter. | |
| const spi::FilterPtr | getFirstFilter () const |
| Return the first filter in the filter chain for this Appender. | |
| LayoutPtr | getLayout () const override |
| Returns the layout of this appender. | |
| LogString | getName () const override |
| Returns the name of this Appender. | |
| const LevelPtr | getThreshold () const |
| Returns this appenders threshold level. | |
| bool | isAsSevereAsThreshold (const LevelPtr &level) const |
| Check whether the message level is below the appender's threshold. | |
| void | doAppend (const spi::LoggingEventPtr &event) override |
| Call AppenderSkeleton::doAppendImpl after acquiring a lock that prevents other threads from concurrently executing AppenderSkeleton::doAppendImpl. | |
| void | setErrorHandler (const spi::ErrorHandlerPtr &eh) |
Set the ErrorHandler for this Appender. | |
| void | setLayout (const LayoutPtr &layout1) override |
| Set the layout for this appender. | |
| void | setName (const LogString &name1) override |
| Set the name of this Appender. | |
| void | setThreshold (const LevelPtr &threshold) |
| Set the threshold level. | |
| void | activateOptions (helpers::Pool &) |
| Public Member Functions inherited from log4cxx::Appender | |
| virtual | ~Appender () |
| void | doAppend (const spi::LoggingEventPtr &event, helpers::Pool &pool) |
| 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 | |
| void | subAppend (const spi::LoggingEventPtr &event) override |
| Rollover the file if required before calling WriterAppender::subAppend. | |
| Protected Member Functions inherited from log4cxx::rolling::RollingFileAppender | |
| RollingFileAppender (std::unique_ptr< RollingFileAppenderPriv > priv) | |
An appender that uses the sub-classed priv instance data. | |
| void | subAppend (const spi::LoggingEventPtr &event) override |
| Rollover the file if required before calling WriterAppender::subAppend. | |
| Protected Member Functions inherited from log4cxx::FileAppender | |
| FileAppender (std::unique_ptr< FileAppenderPriv > priv) | |
| Protected Member Functions inherited from log4cxx::WriterAppender | |
| WriterAppender (const LayoutPtr &layout, const helpers::WriterPtr &writer=helpers::WriterPtr()) | |
An appender that writes spi::LoggingEvent messages formatted by layout to the character stream attached to writer. | |
| WriterAppender (std::unique_ptr< WriterAppenderPriv > priv) | |
An appender that uses the sub-classed priv instance data. | |
| virtual bool | checkEntryConditions () const |
| This method determines if there is a sense in attempting to append. | |
| Protected Member Functions inherited from log4cxx::AppenderSkeleton | |
| AppenderSkeleton (LOG4CXX_PRIVATE_PTR(AppenderSkeletonPrivate) priv) | |
| void | doAppendImpl (const spi::LoggingEventPtr &event) |
Compare event level against the appender threshold and check that event is accepted. | |
| bool | isAccepted (const spi::LoggingEventPtr &event) const |
Does no attached filter deny event or does an attached filter accept event? | |
Additional Inherited Members | |
| Static Public Member Functions inherited from log4cxx::FileAppender | |
| static LogString | stripDuplicateBackslashes (const LogString &name) |
| Replaces double backslashes with single backslashes for compatibility with paths from earlier XML configurations files. | |
| Static Public Attributes inherited from log4cxx::FileAppender | |
| static const int | DefaultBufferedByteCount = 8 * 1024 |
A special version of the RollingFileAppender that acts properly with multiple processes.
Coordinating with other processes adds significant overhead compared to RollingFileAppender. Benchmarks show the overhead of this appender is more than 3 and 10 times the overhead of RollingFileAppender on Linux and Windows respectively.
Note: Do not set the option Append to false. Rolling over files is only relevant when you are appending.
| log4cxx::rolling::MultiprocessRollingFileAppender::MultiprocessRollingFileAppender | ( | ) |
An unconfigured Appender.
|
overridevirtual |
Derived appenders should override this method if option structure requires it.
Reimplemented from log4cxx::FileAppender.
|
overrideprotectedvirtual |
Rollover the file if required before calling WriterAppender::subAppend.
Reimplemented from log4cxx::WriterAppender.