Logger Class Reference

This is the central class in the log4cxx package. More...

Inheritance diagram for Logger:

## Public Member Functions

| ~Logger ()
void | addRef () const
void | releaseRef () const
virtual void | addAppender (const AppenderPtr &newAppender)
| Add `newAppender` to the list of appenders of this Logger instance. More...
void | callAppenders (const log4cxx::spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p) const
| Call the appenders in the hierrachy starting at `this`. More...
void | closeNestedAppenders ()
| Close all attached appenders implementing the AppenderAttachable interface. More...
void | debug (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the DEBUG level. More...
void | debug (const std::string &msg) const
| Log a message string with the DEBUG level. More...
void | debug (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the DEBUG level. More...
void | debug (const std::wstring &msg) const
| Log a message string with the DEBUG level. More...
void | debug (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the DEBUG level. More...
void | debug (const std::basic_string< UniChar > &msg) const
| Log a message string with the DEBUG level. More...
void | debug (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the DEBUG level. More...
void | debug (const CFStringRef &msg) const
| Log a message string with the DEBUG level. More...
void | error (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | error (const std::string &msg) const
| Log a message string with the ERROR level. More...
void | error (const std::wstring &msg) const
| Log a message string with the ERROR level. More...
void | error (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | error (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | error (const std::basic_string< UniChar > &msg) const
| Log a message string with the ERROR level. More...
void | error (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | error (const CFStringRef &msg) const
| Log a message string with the ERROR level. More...
void | fatal (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the FATAL level. More...
void | fatal (const std::string &msg) const
| Log a message string with the ERROR level. More...
void | fatal (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | fatal (const std::wstring &msg) const
| Log a message string with the ERROR level. More...
void | fatal (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | fatal (const std::basic_string< UniChar > &msg) const
| Log a message string with the ERROR level. More...
void | fatal (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the ERROR level. More...
void | fatal (const CFStringRef &msg) const
| Log a message string with the ERROR level. More...
void | forcedLog (const LevelPtr &level, const std::string &message, const log4cxx::spi::LocationInfo &location) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const std::string &message) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const std::wstring &message) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const std::basic_string< UniChar > &message, const log4cxx::spi::LocationInfo &location) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const std::basic_string< UniChar > &message) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const CFStringRef &message, const log4cxx::spi::LocationInfo &location) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLog (const LevelPtr &level, const CFStringRef &message) const
| This method creates a new logging event and logs the event without further checks. More...
void | forcedLogLS (const LevelPtr &level, const LogString &message, const log4cxx::spi::LocationInfo &location) const
| This method creates a new logging event and logs the event without further checks. More...
bool | getAdditivity () const
| Get the additivity flag for this Logger instance. More...
AppenderList | getAllAppenders () const
| Get the appenders contained in this logger as an AppenderList. More...
AppenderPtr | getAppender (const LogString &name) const
| Look for the appender named as `name`. More...
virtual const LevelPtr & | getEffectiveLevel () const
| Starting from this logger, search the logger hierarchy for a non-null level and return it. More...
log4cxx::spi::LoggerRepositoryPtr | getLoggerRepository () const
| Return the the LoggerRepository where this `Logger` is attached. More...
const LogString & | getName () const
| Get the logger name. More...
void | getName (std::string &name) const
| Get logger name in current encoding. More...
void | getName (std::wstring &name) const
| Get logger name. More...
void | getName (std::basic_string< UniChar > &name) const
| Get logger name. More...
void | getName (CFStringRef &name) const
| Get logger name. More...
LoggerPtr | getParent () const
| Returns the parent of this logger. More...
LevelPtr | getLevel () const
| Returns the assigned Level, if any, for this Logger. More...
helpers::ResourceBundlePtr | getResourceBundle () const
| Return the inherited ResourceBundle for this logger. More...
void | info (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the INFO level. More...
void | info (const std::string &msg) const
void | info (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the INFO level. More...
void | info (const std::wstring &msg) const
| Log a message string with the INFO level. More...
void | info (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the INFO level. More...
void | info (const std::basic_string< UniChar > &msg) const
| Log a message string with the INFO level. More...
void | info (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the INFO level. More...
void | info (const CFStringRef &msg) const
| Log a message string with the INFO level. More...
bool | isAttached (const AppenderPtr &appender) const
| Is the appender passed as parameter attached to this logger? More...
bool | isDebugEnabled () const
| Check whether this logger is enabled for the `DEBUG` Level. More...
bool | isEnabledFor (const LevelPtr &level) const
| Check whether this logger is enabled for a given Level passed as parameter. More...
bool | isInfoEnabled () const
| Check whether this logger is enabled for the info Level. More...
bool | isWarnEnabled () const
| Check whether this logger is enabled for the warn Level. More...
bool | isErrorEnabled () const
| Check whether this logger is enabled for the error Level. More...
bool | isFatalEnabled () const
| Check whether this logger is enabled for the fatal Level. More...
bool | isTraceEnabled () const
| Check whether this logger is enabled for the trace level. More...
void | l7dlog (const LevelPtr &level, const LogString &key, const log4cxx::spi::LocationInfo &locationInfo, const std::vector< LogString > &values) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val1) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val1, const std::string &val2) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::string &key, const log4cxx::spi::LocationInfo &locationInfo, const std::string &val1, const std::string &val2, const std::string &val3) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val1) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val1, const std::wstring &val2) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::wstring &key, const log4cxx::spi::LocationInfo &locationInfo, const std::wstring &val1, const std::wstring &val2, const std::wstring &val3) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1, const std::basic_string< UniChar > &val2) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const std::basic_string< UniChar > &key, const log4cxx::spi::LocationInfo &locationInfo, const std::basic_string< UniChar > &val1, const std::basic_string< UniChar > &val2, const std::basic_string< UniChar > &val3) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, const CFStringRef &val1) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, const CFStringRef &val1, const CFStringRef &val2) const
| Log a localized and parameterized message. More...
void | l7dlog (const LevelPtr &level, const CFStringRef &key, const log4cxx::spi::LocationInfo &locationInfo, const CFStringRef &val1, const CFStringRef &val2, const CFStringRef &val3) const
| Log a localized and parameterized message. More...
void | log (const LevelPtr &level, const std::string &message, const log4cxx::spi::LocationInfo &location) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const std::string &message) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const std::wstring &message, const log4cxx::spi::LocationInfo &location) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const std::wstring &message) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const std::basic_string< UniChar > &message, const log4cxx::spi::LocationInfo &location) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const std::basic_string< UniChar > &message) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const CFStringRef &message, const log4cxx::spi::LocationInfo &location) const
| This is the most generic printing method. More...
void | log (const LevelPtr &level, const CFStringRef &message) const
| This is the most generic printing method. More...
void | logLS (const LevelPtr &level, const LogString &message, const log4cxx::spi::LocationInfo &location) const
| This is the most generic printing method. More...
void | removeAllAppenders ()
| Remove all previously added appenders from this logger instance. More...
void | removeAppender (const AppenderPtr &appender)
| Remove the appender passed as parameter form the list of appenders. More...
void | removeAppender (const LogString &name)
| Remove the appender with the name passed as parameter form the list of appenders. More...
void | setAdditivity (bool additive)
| Set the additivity flag for this Logger instance. More...
virtual void | setLevel (const LevelPtr &level)
| Set the level of this Logger. More...
void | setResourceBundle (const helpers::ResourceBundlePtr &bundle)
| Set the resource bundle to be used with localized logging methods. More...
void | warn (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the WARN level. More...
void | warn (const std::wstring &msg) const
| Log a message string with the WARN level. More...
void | warn (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the WARN level. More...
void | warn (const std::basic_string< UniChar > &msg) const
| Log a message string with the WARN level. More...
void | warn (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the WARN level. More...
void | warn (const CFStringRef &msg) const
| Log a message string with the WARN level. More...
void | warn (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the WARN level. More...
void | warn (const std::string &msg) const
| Log a message string with the WARN level. More...
void | trace (const std::wstring &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the TRACE level. More...
void | trace (const std::wstring &msg) const
| Log a message string with the TRACE level. More...
void | trace (const std::basic_string< UniChar > &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the TRACE level. More...
void | trace (const std::basic_string< UniChar > &msg) const
| Log a message string with the TRACE level. More...
void | trace (const CFStringRef &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the TRACE level. More...
void | trace (const CFStringRef &msg) const
| Log a message string with the TRACE level. More...
void | trace (const std::string &msg, const log4cxx::spi::LocationInfo &location) const
| Log a message string with the TRACE level. More...
void | trace (const std::string &msg) const
| Log a message string with the TRACE level. More...
const log4cxx::helpers::Mutex & | getMutex () const
Public Member Functions inherited from AppenderAttachable
virtual | ~AppenderAttachable ()
Public Member Functions inherited from Object
virtual const helpers::Class & | getClass () const
virtual | ~Object ()
virtual bool | instanceof (const Class &clazz) const =0
virtual const void * | cast (const Class &clazz) const =0
Public Member Functions inherited from ObjectImpl
| ObjectImpl ()
virtual | ~ObjectImpl ()

## Static Public Member Functions

static LoggerPtr | getLogger (const std::string &name)
| Retrieve a logger by name in current encoding. More...
static LoggerPtr | getLogger (const char *const name)
| Retrieve a logger by name in current encoding. More...
static LoggerPtr | getLogger (const std::wstring &name)
| Retrieve a logger by name. More...
static LoggerPtr | getLogger (const wchar_t *const name)
| Retrieve a logger by name. More...
static LoggerPtr | getLogger (const std::basic_string< UniChar > &name)
| Retrieve a logger by name. More...
static LoggerPtr | getLogger (const CFStringRef &name)
| Retrieve a logger by name. More...
static LoggerPtr | getLoggerLS (const LogString &name)
| Retrieve a logger by name in Unicode. More...
static LoggerPtr | getRootLogger ()
| Retrieve the root logger. More...
static LoggerPtr | getLoggerLS (const LogString &name, const log4cxx::spi::LoggerFactoryPtr &factory)
| Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter. More...
static LoggerPtr | getLogger (const std::string &name, const log4cxx::spi::LoggerFactoryPtr &factory)
| Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter. More...
static LoggerPtr | getLogger (const std::wstring &name, const log4cxx::spi::LoggerFactoryPtr &factory)
| Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter. More...
static LoggerPtr | getLogger (const std::basic_string< UniChar > &name, const log4cxx::spi::LoggerFactoryPtr &factory)
| Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter. More...
static LoggerPtr | getLogger (const CFStringRef &name, const log4cxx::spi::LoggerFactoryPtr &factory)
| Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter. More...
Static Public Member Functions inherited from Object
static const helpers::Class & | getStaticClass ()
static const log4cxx::helpers::ClassRegistration & | registerClass ()

## Protected Member Functions

| Logger (log4cxx::helpers::Pool &pool, const LogString &name)
| This constructor created a new `logger` instance and sets its name. More...
LogString | getResourceBundleString (const LogString &key) const
| Returns the string resource coresponding to `key` in this logger's inherited resource bundle. More...
void | setHierarchy (spi::LoggerRepository *repository)
| Only the Hierarchy class can set the hierarchy of a logger. More...

## Protected Attributes

LogString | name
| The name of this logger. More...
LevelPtr | level
| The assigned level of this logger. More...
LoggerPtr | parent
| The parent of this logger. More...
helpers::ResourceBundlePtr | resourceBundle
| The resourceBundle for localized messages. More...
log4cxx::spi::LoggerRepository * | repository
helpers::AppenderAttachableImplPtr | aai
bool | additive
| Additivity is set to true by default, that is children inherit the appenders of their ancestors by default. More...
Protected Attributes inherited from ObjectImpl
unsigned int volatile | ref

## Friends

class | DefaultLoggerFactory
class | Hierarchy
class | log4cxx::helpers::synchronized

## Detailed Description

This is the central class in the log4cxx package.

Most logging operations, except configuration, are done through this class.

## Constructor & Destructor Documentation

## Logger()

Logger | ( | log4cxx::helpers::Pool & | pool,
|  | const LogString & | name
| ) |  |

protected

This constructor created a new `logger` instance and sets its name.

It is intended to be used by sub-classes only. You should not create categories directly.

Parameters

  pool | lifetime of pool must be longer than logger.
  name | The name of the logger.

## ~Logger()

~Logger | ( |  | ) |

## Member Function Documentation

## addAppender()

virtual void addAppender | ( | const AppenderPtr & | newAppender | ) |

virtual

Add `newAppender` to the list of appenders of this Logger instance.

If `newAppender` is already in the list of appenders, then it won't be added again.

Implements AppenderAttachable.

## addRef()

void addRef | ( |  | ) | const

virtual

Reimplemented from ObjectImpl.

## callAppenders()

void callAppenders | ( | const log4cxx::spi::LoggingEventPtr & | event,
|  | log4cxx::helpers::Pool & | p
| ) |  | const

Call the appenders in the hierrachy starting at `this`.

If no appenders could be found, emit a warning.

This method calls all the appenders inherited from the hierarchy circumventing any evaluation of whether to log or not to log the particular log request.

Parameters

  event | the event to log.
  p | memory pool for any allocations needed to process request.

## closeNestedAppenders()

void closeNestedAppenders | ( |  | ) |

Close all attached appenders implementing the AppenderAttachable interface.

## debug() [1/8]

void debug | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## debug() [2/8]

void debug | ( | const std::string & | msg | ) | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## debug() [3/8]

void debug | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## debug() [4/8]

void debug | ( | const std::wstring & | msg | ) | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## debug() [5/8]

void debug | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## debug() [6/8]

void debug | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## debug() [7/8]

void debug | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## debug() [8/8]

void debug | ( | const CFStringRef & | msg | ) | const

Log a message string with the DEBUG level.

This method first checks if this logger is `DEBUG` enabled by comparing the level of this logger with the DEBUG level. If this logger is `DEBUG` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## error() [1/8]

void error | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## error() [2/8]

void error | ( | const std::string & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## error() [3/8]

void error | ( | const std::wstring & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## error() [4/8]

void error | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## error() [5/8]

void error | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## error() [6/8]

void error | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## error() [7/8]

void error | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## error() [8/8]

void error | ( | const CFStringRef & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## fatal() [1/8]

void fatal | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the FATAL level.

This method first checks if this logger is `FATAL` enabled by comparing the level of this logger with the FATAL level. If this logger is `FATAL` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## fatal() [2/8]

void fatal | ( | const std::string & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## fatal() [3/8]

void fatal | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## fatal() [4/8]

void fatal | ( | const std::wstring & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## fatal() [5/8]

void fatal | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## fatal() [6/8]

void fatal | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## fatal() [7/8]

void fatal | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## fatal() [8/8]

void fatal | ( | const CFStringRef & | msg | ) | const

Log a message string with the ERROR level.

This method first checks if this logger is `ERROR` enabled by comparing the level of this logger with the ERROR level. If this logger is `ERROR` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## forcedLog() [1/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::string & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.
  location | location of source of logging request.

## forcedLog() [2/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::string & | message
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.

## forcedLog() [3/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::wstring & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.
  location | location of source of logging request.

## forcedLog() [4/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::wstring & | message
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.

## forcedLog() [5/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.
  location | location of source of logging request.

## forcedLog() [6/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | message
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.

## forcedLog() [7/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const CFStringRef & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.
  location | location of source of logging request.

## forcedLog() [8/8]

void forcedLog | ( | const LevelPtr & | level,
|  | const CFStringRef & | message
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | message.

## forcedLogLS()

void forcedLogLS | ( | const LevelPtr & | level,
|  | const LogString & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This method creates a new logging event and logs the event without further checks.

Parameters

  level | the level to log.
  message | the message string to log.
  location | location of the logging statement.

## getAdditivity()

bool getAdditivity | ( |  | ) | const

Get the additivity flag for this Logger instance.

## getAllAppenders()

AppenderList getAllAppenders | ( |  | ) | const

virtual

Get the appenders contained in this logger as an AppenderList.

If no appenders can be found, then an empty AppenderList is returned.

Returns
  AppenderList An collection of the appenders in this logger.

Implements AppenderAttachable.

## getAppender()

AppenderPtr getAppender | ( | const LogString & | name | ) | const

virtual

Look for the appender named as `name`.

Return the appender with that name if in the list. Return `NULL` otherwise.

Implements AppenderAttachable.

## getEffectiveLevel()

virtual const LevelPtr& getEffectiveLevel | ( |  | ) | const

virtual

Starting from this logger, search the logger hierarchy for a non-null level and return it.

The Logger class is designed so that this method executes as quickly as possible.

Exceptions

  RuntimeException | if all levels are null in the hierarchy

Reimplemented in RootLogger.

## getLevel()

LevelPtr getLevel | ( |  | ) | const

Returns the assigned Level, if any, for this Logger.

Returns
  Level - the assigned Level, can be null.

## getLogger() [1/10]

static LoggerPtr getLogger | ( | const std::string & | name | ) |

static

Retrieve a logger by name in current encoding.

Parameters

  name | logger name.

## getLogger() [2/10]

static LoggerPtr getLogger | ( | const char *const | name | ) |

static

Retrieve a logger by name in current encoding.

Parameters

  name | logger name.

## getLogger() [3/10]

static LoggerPtr getLogger | ( | const std::wstring & | name | ) |

static

Retrieve a logger by name.

Parameters

  name | logger name.

## getLogger() [4/10]

static LoggerPtr getLogger | ( | const wchar_t *const | name | ) |

static

Retrieve a logger by name.

Parameters

  name | logger name.

## getLogger() [5/10]

static LoggerPtr getLogger | ( | const std::basic_string< UniChar > & | name | ) |

static

Retrieve a logger by name.

Parameters

  name | logger name.

## getLogger() [6/10]

static LoggerPtr getLogger | ( | const CFStringRef & | name | ) |

static

Retrieve a logger by name.

Parameters

  name | logger name.

## getLogger() [7/10]

static LoggerPtr getLogger | ( | const std::string & | name,
|  | const log4cxx::spi::LoggerFactoryPtr & | factory
| ) |  |

static

Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter.

This method is intended to be used by sub-classes.

Parameters

  name | The name of the logger to retrieve.
  factory | A LoggerFactory implementation that will actually create a new Instance.

## getLogger() [8/10]

static LoggerPtr getLogger | ( | const std::wstring & | name,
|  | const log4cxx::spi::LoggerFactoryPtr & | factory
| ) |  |

static

Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter.

This method is intended to be used by sub-classes.

Parameters

  name | The name of the logger to retrieve.
  factory | A LoggerFactory implementation that will actually create a new Instance.

## getLogger() [9/10]

static LoggerPtr getLogger | ( | const std::basic_string< UniChar > & | name,
|  | const log4cxx::spi::LoggerFactoryPtr & | factory
| ) |  |

static

Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter.

This method is intended to be used by sub-classes.

Parameters

  name | The name of the logger to retrieve.
  factory | A LoggerFactory implementation that will actually create a new Instance.

## getLogger() [10/10]

static LoggerPtr getLogger | ( | const CFStringRef & | name,
|  | const log4cxx::spi::LoggerFactoryPtr & | factory
| ) |  |

static

Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter.

This method is intended to be used by sub-classes.

Parameters

  name | The name of the logger to retrieve.
  factory | A LoggerFactory implementation that will actually create a new Instance.

## getLoggerLS() [1/2]

static LoggerPtr getLoggerLS | ( | const LogString & | name | ) |

static

Retrieve a logger by name in Unicode.

Parameters

  name | logger name.

## getLoggerLS() [2/2]

static LoggerPtr getLoggerLS | ( | const LogString & | name,
|  | const log4cxx::spi::LoggerFactoryPtr & | factory
| ) |  |

static

Like getLogger except that the type of logger instantiated depends on the type returned by the LoggerFactory::makeNewLoggerInstance method of the `factory` parameter.

This method is intended to be used by sub-classes.

Parameters

  name | The name of the logger to retrieve.
  factory | A LoggerFactory implementation that will actually create a new Instance.

## getLoggerRepository()

log4cxx::spi::LoggerRepositoryPtr getLoggerRepository | ( |  | ) | const

Return the the LoggerRepository where this `Logger` is attached.

## getMutex()

const log4cxx::helpers::Mutex& getMutex | ( |  | ) | const

inline

## getName() [1/5]

const LogString& getName | ( |  | ) | const

inline

Get the logger name.

Returns
  logger name as LogString.

## getName() [2/5]

void getName | ( | std::string & | name | ) | const

Get logger name in current encoding.

Parameters

  name | buffer to which name is appended.

## getName() [3/5]

void getName | ( | std::wstring & | name | ) | const

Get logger name.

Parameters

  name | buffer to which name is appended.

## getName() [4/5]

void getName | ( | std::basic_string< UniChar > & | name | ) | const

Get logger name.

Parameters

  name | buffer to which name is appended.

## getName() [5/5]

void getName | ( | CFStringRef & | name | ) | const

Get logger name.

Parameters

  name | buffer to which name is appended.

## getParent()

LoggerPtr getParent | ( |  | ) | const

Returns the parent of this logger.

Note that the parent of a given logger may change during the lifetime of the logger.

The root logger will return `0`.

## getResourceBundle()

helpers::ResourceBundlePtr getResourceBundle | ( |  | ) | const

Return the inherited ResourceBundle for this logger.

This method walks the hierarchy to find the appropriate resource bundle. It will return the resource bundle attached to the closest ancestor of this logger, much like the way priorities are searched. In case there is no bundle in the hierarchy then `NULL` is returned.

## getResourceBundleString()

LogString getResourceBundleString | ( | const LogString & | key | ) | const

protected

Returns the string resource coresponding to `key` in this logger's inherited resource bundle.

If the resource cannot be found, then an error message will be logged complaining about the missing resource.

See also
  getResourceBundle.

## getRootLogger()

static LoggerPtr getRootLogger | ( |  | ) |

static

Retrieve the root logger.

## info() [1/8]

void info | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## info() [2/8]

void info | ( | const std::string & | msg | ) | const

## info() [3/8]

void info | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## info() [4/8]

void info | ( | const std::wstring & | msg | ) | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## info() [5/8]

void info | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## info() [6/8]

void info | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## info() [7/8]

void info | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## info() [8/8]

void info | ( | const CFStringRef & | msg | ) | const

Log a message string with the INFO level.

This method first checks if this logger is `INFO` enabled by comparing the level of this logger with the INFO level. If this logger is `INFO` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## isAttached()

bool isAttached | ( | const AppenderPtr & | appender | ) | const

virtual

Is the appender passed as parameter attached to this logger?

Implements AppenderAttachable.

## isDebugEnabled()

bool isDebugEnabled | ( |  | ) | const

Check whether this logger is enabled for the `DEBUG` Level.

This function is intended to lessen the computational cost of disabled log debug statements.

For some `logger` Logger object, when you write,

        logger->debug("debug message");

You incur the cost constructing the message, concatenation in this case, regardless of whether the message is logged or not.

If you are worried about speed, then you should write

      if(logger->isDebugEnabled()) {
        logger->debug("debug message");
      }

This way you will not incur the cost of parameter construction if debugging is disabled for `logger`. On the other hand, if the `logger` is debug enabled, you will incur the cost of evaluating whether the logger is debug enabled twice. Once in `isDebugEnabled` and once in the `debug`. This is an insignificant overhead since evaluating a logger takes about 1%% of the time it takes to actually log.

Returns
  bool - `true` if this logger is debug enabled, `false` otherwise.

## isEnabledFor()

bool isEnabledFor | ( | const LevelPtr & | level | ) | const

Check whether this logger is enabled for a given Level passed as parameter.

See also isDebugEnabled.

Returns
  bool True if this logger is enabled for `level`.

## isErrorEnabled()

bool isErrorEnabled | ( |  | ) | const

Check whether this logger is enabled for the error Level.

See also isDebugEnabled.

Returns
  bool - `true` if this logger is enabled for level error, `false` otherwise.

## isFatalEnabled()

bool isFatalEnabled | ( |  | ) | const

Check whether this logger is enabled for the fatal Level.

See also isDebugEnabled.

Returns
  bool - `true` if this logger is enabled for level fatal, `false` otherwise.

## isInfoEnabled()

bool isInfoEnabled | ( |  | ) | const

Check whether this logger is enabled for the info Level.

See also isDebugEnabled.

Returns
  bool - `true` if this logger is enabled for level info, `false` otherwise.

## isTraceEnabled()

bool isTraceEnabled | ( |  | ) | const

Check whether this logger is enabled for the trace level.

See also isDebugEnabled.

Returns
  bool - `true` if this logger is enabled for level trace, `false` otherwise.

## isWarnEnabled()

bool isWarnEnabled | ( |  | ) | const

Check whether this logger is enabled for the warn Level.

See also isDebugEnabled.

Returns
  bool - `true` if this logger is enabled for level warn, `false` otherwise.

## l7dlog() [1/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const LogString & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::vector< LogString > & | values
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  values | The values for the placeholders `{0}`, `{1}` etc. within the pattern.

See also
  setResourceBundle

## l7dlog() [2/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::string & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.

See also
  setResourceBundle

## l7dlog() [3/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::string & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::string & | val1
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The first value for the placeholders within the pattern.

See also
  setResourceBundle

## l7dlog() [4/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::string & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::string & | val1,
|  | const std::string & | val2
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The first value for the placeholders within the pattern.
  val2 | The second value for the placeholders within the pattern.

See also
  setResourceBundle

## l7dlog() [5/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::string & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::string & | val1,
|  | const std::string & | val2,
|  | const std::string & | val3
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.
  val3 | The value for the third placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [6/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::wstring & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.

See also
  setResourceBundle

## l7dlog() [7/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::wstring & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::wstring & | val1
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [8/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::wstring & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::wstring & | val1,
|  | const std::wstring & | val2
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [9/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::wstring & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::wstring & | val1,
|  | const std::wstring & | val2,
|  | const std::wstring & | val3
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.
  val3 | The value for the third placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [10/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.

See also
  setResourceBundle

## l7dlog() [11/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::basic_string< UniChar > & | val1
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [12/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::basic_string< UniChar > & | val1,
|  | const std::basic_string< UniChar > & | val2
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [13/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const std::basic_string< UniChar > & | val1,
|  | const std::basic_string< UniChar > & | val2,
|  | const std::basic_string< UniChar > & | val3
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.
  val3 | The value for the third placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [14/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const CFStringRef & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.

See also
  setResourceBundle

## l7dlog() [15/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const CFStringRef & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const CFStringRef & | val1
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [16/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const CFStringRef & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const CFStringRef & | val1,
|  | const CFStringRef & | val2
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.

See also
  setResourceBundle

## l7dlog() [17/17]

void l7dlog | ( | const LevelPtr & | level,
|  | const CFStringRef & | key,
|  | const log4cxx::spi::LocationInfo & | locationInfo,
|  | const CFStringRef & | val1,
|  | const CFStringRef & | val2,
|  | const CFStringRef & | val3
| ) |  | const

Log a localized and parameterized message.

First, the user supplied `key` is searched in the resource bundle. Next, the resulting pattern is formatted using helpers::StringHelper::format method with the user supplied string array `params`.

Parameters

  level | The level of the logging request.
  key | The key to be searched in the ResourceBundle.
  locationInfo | The location info of the logging request.
  val1 | The value for the first placeholder within the pattern.
  val2 | The value for the second placeholder within the pattern.
  val3 | The value for the third placeholder within the pattern.

See also
  setResourceBundle

## log() [1/8]

void log | ( | const LevelPtr & | level,
|  | const std::string & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.
  location | The source file of the logging request, may be null.

## log() [2/8]

void log | ( | const LevelPtr & | level,
|  | const std::string & | message
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.

## log() [3/8]

void log | ( | const LevelPtr & | level,
|  | const std::wstring & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.
  location | The source file of the logging request, may be null.

## log() [4/8]

void log | ( | const LevelPtr & | level,
|  | const std::wstring & | message
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.

## log() [5/8]

void log | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.
  location | The source file of the logging request, may be null.

## log() [6/8]

void log | ( | const LevelPtr & | level,
|  | const std::basic_string< UniChar > & | message
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.

## log() [7/8]

void log | ( | const LevelPtr & | level,
|  | const CFStringRef & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.
  location | The source file of the logging request, may be null.

## log() [8/8]

void log | ( | const LevelPtr & | level,
|  | const CFStringRef & | message
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.

## logLS()

void logLS | ( | const LevelPtr & | level,
|  | const LogString & | message,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

This is the most generic printing method.

It is intended to be invoked by wrapper classes.

Parameters

  level | The level of the logging request.
  message | The message of the logging request.
  location | The source file of the logging request, may be null.

## releaseRef()

void releaseRef | ( |  | ) | const

virtual

Reimplemented from ObjectImpl.

## removeAllAppenders()

void removeAllAppenders | ( |  | ) |

virtual

Remove all previously added appenders from this logger instance.

This is useful when re-reading configuration information.

Implements AppenderAttachable.

## removeAppender() [1/2]

void removeAppender | ( | const AppenderPtr & | appender | ) |

virtual

Remove the appender passed as parameter form the list of appenders.

Implements AppenderAttachable.

## removeAppender() [2/2]

void removeAppender | ( | const LogString & | name | ) |

virtual

Remove the appender with the name passed as parameter form the list of appenders.

Implements AppenderAttachable.

## setAdditivity()

void setAdditivity | ( | bool | additive | ) |

Set the additivity flag for this Logger instance.

## setHierarchy()

void setHierarchy | ( | spi::LoggerRepository * | repository | ) |

protected

Only the Hierarchy class can set the hierarchy of a logger.

## setLevel()

virtual void setLevel | ( | const LevelPtr & | level | ) |

virtual

Set the level of this Logger.

As in

        logger->setLevel(Level::getDebug());

Null values are admitted.

Reimplemented in RootLogger.

## setResourceBundle()

void setResourceBundle | ( | const helpers::ResourceBundlePtr & | bundle | ) |

inline

Set the resource bundle to be used with localized logging methods.

## trace() [1/8]

void trace | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## trace() [2/8]

void trace | ( | const std::wstring & | msg | ) | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## trace() [3/8]

void trace | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## trace() [4/8]

void trace | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## trace() [5/8]

void trace | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## trace() [6/8]

void trace | ( | const CFStringRef & | msg | ) | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## trace() [7/8]

void trace | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## trace() [8/8]

void trace | ( | const std::string & | msg | ) | const

Log a message string with the TRACE level.

This method first checks if this logger is `TRACE` enabled by comparing the level of this logger with the TRACE level. If this logger is `TRACE` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## warn() [1/8]

void warn | ( | const std::wstring & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## warn() [2/8]

void warn | ( | const std::wstring & | msg | ) | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## warn() [3/8]

void warn | ( | const std::basic_string< UniChar > & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## warn() [4/8]

void warn | ( | const std::basic_string< UniChar > & | msg | ) | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## warn() [5/8]

void warn | ( | const CFStringRef & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## warn() [6/8]

void warn | ( | const CFStringRef & | msg | ) | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## warn() [7/8]

void warn | ( | const std::string & | msg,
|  | const log4cxx::spi::LocationInfo & | location
| ) |  | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.
  location | location of source of logging request.

## warn() [8/8]

void warn | ( | const std::string & | msg | ) | const

Log a message string with the WARN level.

This method first checks if this logger is `WARN` enabled by comparing the level of this logger with the WARN level. If this logger is `WARN` enabled, it proceeds to call all the registered appenders in this logger and also higher in the hierarchy depending on the value of the additivity flag.

Parameters

  msg | the message string to log.

## Friends And Related Function Documentation

## DefaultLoggerFactory

friend class DefaultLoggerFactory

friend

## Hierarchy

friend class Hierarchy

friend

## log4cxx::helpers::synchronized

friend class log4cxx::helpers::synchronized

friend

## Member Data Documentation

## aai

helpers::AppenderAttachableImplPtr aai

protected

## additive

bool additive

protected

Additivity is set to true by default, that is children inherit the appenders of their ancestors by default.

If this variable is set to `false` then the appenders found in the ancestors of this logger are not used. However, the children of this logger will inherit its appenders, unless the children have their additivity flag set to `false` too. See the user manual for more details.

## level

LevelPtr level

protected

The assigned level of this logger.

The `level` variable need not be assigned a value in which case it is inherited form the hierarchy.

## name

LogString name

protected

The name of this logger.

## parent

LoggerPtr parent

protected

The parent of this logger.

All loggers have at least one ancestor which is the root logger.

## repository

log4cxx::spi::LoggerRepository* repository

protected

## resourceBundle

helpers::ResourceBundlePtr resourceBundle

protected

The resourceBundle for localized messages.

See also
  setResourceBundle, getResourceBundle

The documentation for this class was generated from the following file:

- logger.h