Apache log4cxx  Version 0.13.0
log4cxx::spi::RootLogger Class Reference

RootLogger sits at the top of the logger hierachy. More...

#include <rootlogger.h>

Inheritance diagram for log4cxx::spi::RootLogger:
log4cxx::Logger log4cxx::spi::AppenderAttachable log4cxx::helpers::Object log4cxx::helpers::Object

Public Member Functions

 RootLogger (log4cxx::helpers::Pool &pool, const LevelPtr level)
 The root logger names itself as "root". More...
 
 ~RootLogger ()
 
virtual const LevelPtrgetEffectiveLevel () const
 Return the assigned level value without walking the logger hierarchy. More...
 
void setLevel (const LevelPtr level)
 Setting a null value to the level of the root logger may have catastrophic results. More...
 
- Public Member Functions inherited from log4cxx::Logger
 ~Logger ()
 
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...
 
log4cxx::spi::LoggerRepositorygetLoggerRepository () const
 Return the the LoggerRepository where this Logger is attached. More...
 
const LogStringgetName () 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...
 
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...
 
void reconfigure (const std::vector< AppenderPtr > &appenders, bool additivity)
 Reconfigure this logger by configuring all of the appenders. More...
 
- Public Member Functions inherited from log4cxx::spi::AppenderAttachable
virtual ~AppenderAttachable ()
 
- Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
 
virtual bool instanceof (const Class &clazz) const =0
 
virtual const void * cast (const Class &clazz) const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from log4cxx::Logger
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...
 
- Protected Member Functions inherited from log4cxx::Logger
 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 inherited from log4cxx::Logger
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::LoggerRepositoryrepository
 
helpers::AppenderAttachableImplPtr aai
 
bool additive
 Additivity is set to true by default, that is children inherit the appenders of their ancestors by default. More...
 

Detailed Description

RootLogger sits at the top of the logger hierachy.

It is a regular logger except that it provides several guarantees.

First, it cannot be assigned a null level. Second, since root logger cannot have a parent, the getEffectiveLevel method always returns the value of the level field without walking the hierarchy.

Constructor & Destructor Documentation

◆ RootLogger()

log4cxx::spi::RootLogger::RootLogger ( log4cxx::helpers::Pool pool,
const LevelPtr  level 
)

The root logger names itself as "root".

However, the root logger cannot be retrieved by name.

◆ ~RootLogger()

log4cxx::spi::RootLogger::~RootLogger ( )
inline

Member Function Documentation

◆ getEffectiveLevel()

virtual const LevelPtr& log4cxx::spi::RootLogger::getEffectiveLevel ( ) const
virtual

Return the assigned level value without walking the logger hierarchy.

Reimplemented from log4cxx::Logger.

◆ setLevel()

void log4cxx::spi::RootLogger::setLevel ( const LevelPtr  level)
virtual

Setting a null value to the level of the root logger may have catastrophic results.

We prevent this here.

Reimplemented from log4cxx::Logger.


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