log4cplus Namespace Reference

## Namespaces

namespace | helpers
namespace | device_appender_detail
namespace | thread
namespace | internal
namespace | detail
namespace | pattern
namespace | spi

## Classes

class | ErrorHandler
| This class is used to "handle" errors encountered in an `log4cplus::Appender`. More...
class | OnlyOnceErrorHandler
class | Appender
| Extend this class for implementing your own strategies for printing log statements. More...
class | AsyncAppender
| This Appender is a wrapper to which other appenders can be attached. More...
class | DeviceAppender
class | CallbackAppender
| Send log events to a C function callback. More...
class | CLFSAppender
class | PropertyConfigurator
| Provides configuration from an external file. More...
class | BasicConfigurator
| Use this class to quickly configure the package. More...
class | ConfigureAndWatchThread
class | ConsoleAppender
| ConsoleAppender appends log events to `std::cout` or `std::cerr` using a layout specified by the user. More...
class | exception
| Exception class thrown by LogLog. More...
class | FileAppenderBase
| Base class for Appenders writing log events to a file. More...
class | FileAppender
| Appends log events to a file. More...
class | RollingFileAppender
| RollingFileAppender extends FileAppender to backup the log files when they reach a certain size. More...
class | DailyRollingFileAppender
| DailyRollingFileAppender extends `FileAppender` so that the underlying file is rolled over at a user chosen frequency. More...
class | TimeBasedRollingFileAppender
| TimeBasedRollingFileAppender extends `FileAppenderBase` so that the underlying file is rolled over at a user chosen frequency while also keeping in check a total maximum number of produced files. More...
class | Hierarchy
| This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy. More...
class | HierarchyLocker
| This is used to lock a Hierarchy. More...
class | Initializer
| This class helps with initialization and shutdown of log4cplus. More...
class | Layout
| This class is used to layout strings sent to an `log4cplus::Appender`. More...
class | SimpleLayout
| SimpleLayout consists of the LogLevel of the log statement, followed by " - " and then the log message itself. More...
class | TTCCLayout
| TTCC layout format consists of time, thread, Logger and nested diagnostic context information, hence the name. More...
class | PatternLayout
| A flexible layout configurable with pattern string. More...
class | Log4jUdpAppender
| Sends log events as Log4j XML to a remote a log server. More...
class | Logger
| This is the central class in the log4cplus package. More...
class | DefaultLoggerFactory
| This class is used to create the default implementation of the Logger class. More...
class | LogLevelManager
| This class is used to "manage" LogLevel definitions. More...
class | MDC
class | MSTTSAppender
class | NDC
| The NDC class implements nested diagnostic contexts as defined by Neil Harrison in the article "Patterns for Logging Diagnostic Messages" part of the book "Pattern Languages of Program Design 3" edited by Martin et al. More...
struct | DiagnosticContext
| This is the internal object that is stored on the NDC stack. More...
class | NDCContextCreator
| This class ensures that a NDC::push() call is always matched with a NDC::pop() call even in the face of exceptions. More...
class | NTEventLogAppender
| Appends log events to NT EventLog. More...
class | NullAppender
| Appends log events to a file. More...
class | Qt4DebugAppender
class | Qt5DebugAppender
class | SocketAppender
| Sends `spi::InternalLoggingEvent` objects to a remote a log server. More...
class | SysLogAppender
| Appends log events to a file. More...
class | TraceLogger
| This class is used to produce "Trace" logging. More...
class | Win32ConsoleAppender
| Prints events to Win32 console. More...

## Typedefs

typedef helpers::SharedObjectPtr< Appender > | SharedAppenderPtr
| This is a pointer to an Appender.
typedef helpers::SharedObjectPtr< AsyncAppender > | AsyncAppenderPtr
typedef helpers::SharedObjectPtr< CLFSAppender > | CLFSAppenderPtr
typedef helpers::SharedObjectPtr< FileAppender > | SharedFileAppenderPtr
typedef helpers::SharedObjectPtr< RollingFileAppender > | SharedRollingFileAppenderPtr
typedef helpers::SharedObjectPtr< DailyRollingFileAppender > | SharedDailyRollingFileAppenderPtr
typedef helpers::SharedObjectPtr< TimeBasedRollingFileAppender > | SharedTimeBasedRollingFileAppenderPtr
typedef std::basic_ofstream< tchar > | tofstream
typedef std::basic_ifstream< tchar > | tifstream
typedef std::vector< Logger > | LoggerList
| This is a list of `Loggers`.
typedef int | LogLevel
| Defines the minimum set of priorities recognized by the system, that is `FATAL_LOG_LEVEL`, `ERROR_LOG_LEVEL`, `WARN_LOG_LEVEL`, `INFO_LOG_LEVEL`, `DEBUG_LOG_LEVEL`, and `TRACE_LOG_LEVEL`.
typedef log4cplus::tstring const &(* | LogLevelToStringMethod) (LogLevel)
| This method type defined the signature of methods that convert LogLevels into strings.
typedef LogLevel(* | StringToLogLevelMethod) (const log4cplus::tstring &)
| This method type defined the signature of methods that convert strings into LogLevels.
typedef std::map< tstring, tstring > | MappedDiagnosticContextMap
typedef helpers::SharedObjectPtr< MSTTSAppender > | MSTTSAppenderPtr
typedef std::deque< DiagnosticContext > | DiagnosticContextStack
typedef helpers::SharedObjectPtr< Qt4DebugAppender > | Qt4DebugAppenderPtr
typedef helpers::SharedObjectPtr< Qt5DebugAppender > | Qt5DebugAppenderPtr
typedef std::vector< log4cplus::SharedAppenderPtr > | SharedAppenderPtrList
typedef std::basic_ostream< tchar > | tostream
typedef std::basic_istream< tchar > | tistream
typedef std::basic_ostringstream< tchar > | tostringstream
typedef std::basic_istringstream< tchar > | tistringstream
typedef char | tchar
typedef std::basic_string< tchar > | tstring

## Enumerations

enum | DailyRollingFileSchedule { MONTHLY , WEEKLY , DAILY , TWICE_DAILY , HOURLY , MINUTELY }

## Functions

template<typename T>
SharedAppenderPtr | make_device_appender (T &d, bool close_device=true)
template<typename T>
SharedAppenderPtr | make_device_appender (T &d, const helpers::Properties &props)
template<typename T>
SharedAppenderPtr | make_device_appender_sp (boost::shared_ptr< T > const &p, bool close_device=true)
template<typename T>
SharedAppenderPtr | make_device_appender_sp (boost::shared_ptr< T > const &p, const helpers::Properties &props)
LOG4CPLUS_EXPORT Hierarchy & | getDefaultHierarchy ()
LOG4CPLUS_EXPORT helpers::Time const & | getTTCCLayoutTimeBase ()
LOG4CPLUS_EXPORT LogLevelManager & | getLogLevelManager ()
| Returns the singleton LogLevelManager.
LOG4CPLUS_EXPORT MDC & | getMDC ()
LOG4CPLUS_EXPORT NDC & | getNDC ()
| Return a reference to the singleton object.

## Variables

const LogLevel | OFF_LOG_LEVEL = 60000
| The `OFF_LOG_LEVEL` LogLevel is used during configuration to turn off logging.
const LogLevel | FATAL_LOG_LEVEL = 50000
| The `FATAL_LOG_LEVEL` LogLevel designates very severe error events that will presumably lead the application to abort.
const LogLevel | ERROR_LOG_LEVEL = 40000
| The `ERROR_LOG_LEVEL` LogLevel designates error events that might still allow the application to continue running.
const LogLevel | WARN_LOG_LEVEL = 30000
| The `WARN_LOG_LEVEL` LogLevel designates potentially harmful situations.
const LogLevel | INFO_LOG_LEVEL = 20000
| The `INFO_LOG_LEVEL` LogLevel designates informational messages that highlight the progress of the application at coarse-grained level.
const LogLevel | DEBUG_LOG_LEVEL = 10000
| The `DEBUG_LOG_LEVEL` LogLevel designates fine-grained informational events that are most useful to debug an application.
const LogLevel | TRACE_LOG_LEVEL = 0
| The `TRACE_LOG_LEVEL` LogLevel is used to "trace" entry and exiting of methods.
const LogLevel | ALL_LOG_LEVEL = TRACE_LOG_LEVEL
| The `ALL_LOG_LEVEL` LogLevel is used during configuration to turn on all logging.
const LogLevel | NOT_SET_LOG_LEVEL = -1
| The `NOT_SET_LOG_LEVEL` LogLevel is used to indicated that no particular LogLevel is desired and that the default should be used.
std::size_t const | LOG4CPLUS_MAX_MESSAGE_SIZE = 8*1024
LOG4CPLUS_EXPORT tostream & | tcout
LOG4CPLUS_EXPORT tostream & | tcerr
LOG4CPLUS_EXPORT unsigned const | version
LOG4CPLUS_EXPORT char const | versionStr []

## Typedef Documentation

## AsyncAppenderPtr

typedef helpers::SharedObjectPtr<AsyncAppender> log4cplus::AsyncAppenderPtr

Definition at line 102 of file asyncappender.h.

## CLFSAppenderPtr

typedef helpers::SharedObjectPtr<CLFSAppender> log4cplus::CLFSAppenderPtr

Definition at line 92 of file clfsappender.h.

## DiagnosticContextStack

typedef std::deque<DiagnosticContext> log4cplus::DiagnosticContextStack

Definition at line 44 of file ndc.h.

## LoggerList

typedef std::vector<Logger> log4cplus::LoggerList

This is a list of `Loggers`.

Definition at line 61 of file logger.h.

## LogLevel

typedef int log4cplus::LogLevel

Defines the minimum set of priorities recognized by the system, that is `FATAL_LOG_LEVEL`, `ERROR_LOG_LEVEL`, `WARN_LOG_LEVEL`, `INFO_LOG_LEVEL`, `DEBUG_LOG_LEVEL`, and `TRACE_LOG_LEVEL`.

Definition at line 48 of file loglevel.h.

## LogLevelToStringMethod

typedef log4cplus::tstring const &(* log4cplus::LogLevelToStringMethod) (LogLevel)

This method type defined the signature of methods that convert LogLevels into strings.

Note: Must return an empty `tstring` for unrecognized values.

Definition at line 104 of file loglevel.h.

## MappedDiagnosticContextMap

typedef std::map<tstring, tstring> log4cplus::MappedDiagnosticContextMap

Definition at line 43 of file mdc.h.

## MSTTSAppenderPtr

typedef helpers::SharedObjectPtr<MSTTSAppender> log4cplus::MSTTSAppenderPtr

Definition at line 106 of file msttsappender.h.

## Qt4DebugAppenderPtr

typedef helpers::SharedObjectPtr<Qt4DebugAppender> log4cplus::Qt4DebugAppenderPtr

Definition at line 97 of file qt4debugappender.h.

## Qt5DebugAppenderPtr

typedef helpers::SharedObjectPtr<Qt5DebugAppender> log4cplus::Qt5DebugAppenderPtr

Definition at line 97 of file qt5debugappender.h.

## SharedAppenderPtr

typedef helpers::SharedObjectPtr<Appender> log4cplus::SharedAppenderPtr

This is a pointer to an Appender.

Definition at line 336 of file appender.h.

## SharedAppenderPtrList

typedef std::vector<log4cplus::SharedAppenderPtr> log4cplus::SharedAppenderPtrList

Definition at line 40 of file appenderattachable.h.

## SharedDailyRollingFileAppenderPtr

typedef helpers::SharedObjectPtr<DailyRollingFileAppender> log4cplus::SharedDailyRollingFileAppenderPtr

Definition at line 348 of file fileappender.h.

## SharedFileAppenderPtr

typedef helpers::SharedObjectPtr<FileAppender> log4cplus::SharedFileAppenderPtr

Definition at line 218 of file fileappender.h.

## SharedRollingFileAppenderPtr

typedef helpers::SharedObjectPtr<RollingFileAppender> log4cplus::SharedRollingFileAppenderPtr

Definition at line 269 of file fileappender.h.

## SharedTimeBasedRollingFileAppenderPtr

typedef helpers::SharedObjectPtr<TimeBasedRollingFileAppender> log4cplus::SharedTimeBasedRollingFileAppenderPtr

Definition at line 424 of file fileappender.h.

## StringToLogLevelMethod

typedef LogLevel(* log4cplus::StringToLogLevelMethod) (const log4cplus::tstring &)

This method type defined the signature of methods that convert strings into LogLevels.

Note: Must return `NOT_SET_LOG_LEVEL` for unrecognized values.

Definition at line 113 of file loglevel.h.

## tchar

typedef char log4cplus::tchar

Definition at line 56 of file tchar.h.

## tifstream

typedef std::basic_ifstream<tchar> log4cplus::tifstream

Definition at line 42 of file fstreams.h.

## tistream

typedef std::basic_istream<tchar> log4cplus::tistream

Definition at line 41 of file streams.h.

## tistringstream

typedef std::basic_istringstream<tchar> log4cplus::tistringstream

Definition at line 43 of file streams.h.

## tofstream

typedef std::basic_ofstream<tchar> log4cplus::tofstream

Definition at line 41 of file fstreams.h.

## tostream

typedef std::basic_ostream<tchar> log4cplus::tostream

Definition at line 40 of file streams.h.

## tostringstream

typedef std::basic_ostringstream<tchar> log4cplus::tostringstream

Definition at line 42 of file streams.h.

## tstring

typedef std::basic_string<tchar> log4cplus::tstring

Definition at line 39 of file tstring.h.

## Enumeration Type Documentation

## DailyRollingFileSchedule

enum log4cplus::DailyRollingFileSchedule

Enumerator
MONTHLY |
WEEKLY |
DAILY |
TWICE_DAILY |
HOURLY |
MINUTELY |

Definition at line 272 of file fileappender.h.

## Function Documentation

## getDefaultHierarchy()

LOG4CPLUS_EXPORT Hierarchy & log4cplus::getDefaultHierarchy | ( |  | ) |

References LOG4CPLUS_EXPORT.

## getLogLevelManager()

LOG4CPLUS_EXPORT LogLevelManager & log4cplus::getLogLevelManager | ( |  | ) |

Returns the singleton LogLevelManager.

References LOG4CPLUS_EXPORT.

Referenced by log4cplus::internal::CustomLogLevelManager::add().

## getMDC()

LOG4CPLUS_EXPORT MDC & log4cplus::getMDC | ( |  | ) |

References LOG4CPLUS_EXPORT.

Referenced by log4cplus::spi::InternalLoggingEvent::getMDCCopy().

## getNDC()

LOG4CPLUS_EXPORT NDC & log4cplus::getNDC | ( |  | ) |

Return a reference to the singleton object.

References LOG4CPLUS_EXPORT.

Referenced by log4cplus::spi::InternalLoggingEvent::getNDC().

## getTTCCLayoutTimeBase()

LOG4CPLUS_EXPORT helpers::Time const & log4cplus::getTTCCLayoutTimeBase | ( |  | ) |

References LOG4CPLUS_EXPORT.

## make_device_appender() [1/2]

template<typename T>

SharedAppenderPtr log4cplus::make_device_appender | ( | T & | d,
|  | bool | close_device = true )

inline

Definition at line 157 of file deviceappender.hxx.

## make_device_appender() [2/2]

template<typename T>

SharedAppenderPtr log4cplus::make_device_appender | ( | T & | d,
|  | const helpers::Properties & | props )

inline

Definition at line 167 of file deviceappender.hxx.

## make_device_appender_sp() [1/2]

template<typename T>

SharedAppenderPtr log4cplus::make_device_appender_sp | ( | boost::shared_ptr< T > const & | p,
|  | bool | close_device = true )

inline

Definition at line 177 of file deviceappender.hxx.

## make_device_appender_sp() [2/2]

template<typename T>

SharedAppenderPtr log4cplus::make_device_appender_sp | ( | boost::shared_ptr< T > const & | p,
|  | const helpers::Properties & | props )

inline

Definition at line 189 of file deviceappender.hxx.

## Variable Documentation

## ALL_LOG_LEVEL

const LogLevel log4cplus::ALL_LOG_LEVEL = TRACE_LOG_LEVEL

The `ALL_LOG_LEVEL` LogLevel is used during configuration to turn on all logging.

Definition at line 89 of file loglevel.h.

## DEBUG_LOG_LEVEL

const LogLevel log4cplus::DEBUG_LOG_LEVEL = 10000

The `DEBUG_LOG_LEVEL` LogLevel designates fine-grained informational events that are most useful to debug an application.

Definition at line 79 of file loglevel.h.

## ERROR_LOG_LEVEL

const LogLevel log4cplus::ERROR_LOG_LEVEL = 40000

The `ERROR_LOG_LEVEL` LogLevel designates error events that might still allow the application to continue running.

Definition at line 63 of file loglevel.h.

## FATAL_LOG_LEVEL

const LogLevel log4cplus::FATAL_LOG_LEVEL = 50000

The `FATAL_LOG_LEVEL` LogLevel designates very severe error events that will presumably lead the application to abort.

Definition at line 58 of file loglevel.h.

## INFO_LOG_LEVEL

const LogLevel log4cplus::INFO_LOG_LEVEL = 20000

The `INFO_LOG_LEVEL` LogLevel designates informational messages that highlight the progress of the application at coarse-grained level.

Definition at line 74 of file loglevel.h.

## LOG4CPLUS_MAX_MESSAGE_SIZE

std::size_t const log4cplus::LOG4CPLUS_MAX_MESSAGE_SIZE = 8*1024

Definition at line 44 of file socketappender.h.

## NOT_SET_LOG_LEVEL

const LogLevel log4cplus::NOT_SET_LOG_LEVEL = -1

The `NOT_SET_LOG_LEVEL` LogLevel is used to indicated that no particular LogLevel is desired and that the default should be used.

Definition at line 95 of file loglevel.h.

Referenced by log4cplus::internal::CustomLogLevelManager::customFromStringMethodWorker(), and log4cplus::Appender::isAsSevereAsThreshold().

## OFF_LOG_LEVEL

const LogLevel log4cplus::OFF_LOG_LEVEL = 60000

The `OFF_LOG_LEVEL` LogLevel is used during configuration to turn off logging.

Definition at line 53 of file loglevel.h.

## tcerr

LOG4CPLUS_EXPORT tostream& log4cplus::tcerr

extern

## tcout

LOG4CPLUS_EXPORT tostream& log4cplus::tcout

extern

## TRACE_LOG_LEVEL

const LogLevel log4cplus::TRACE_LOG_LEVEL = 0

The `TRACE_LOG_LEVEL` LogLevel is used to "trace" entry and exiting of methods.

Definition at line 84 of file loglevel.h.

Referenced by log4cplus::TraceLogger::TraceLogger(), and log4cplus::TraceLogger::~TraceLogger().

## version

LOG4CPLUS_EXPORT unsigned const log4cplus::version

extern

## versionStr

LOG4CPLUS_EXPORT char const log4cplus::versionStr[]

extern

## WARN_LOG_LEVEL

const LogLevel log4cplus::WARN_LOG_LEVEL = 30000

The `WARN_LOG_LEVEL` LogLevel designates potentially harmful situations.

Definition at line 68 of file loglevel.h.