Apache log4cxx  Version 0.10.0
RootLogger Class Reference

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

Inheritance diagram for RootLogger:
Logger AppenderAttachable ObjectImpl Object Object

Public Member Functions

 RootLogger (log4cxx::helpers::Pool &pool, const LevelPtr &level)
 The root logger names itself as "root". More...
 
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 Logger
 ~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...
 
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...
 
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::MutexgetMutex () const
 
- Public Member Functions inherited from AppenderAttachable
virtual ~AppenderAttachable ()
 
- Public Member Functions inherited from Object
virtual const helpers::ClassgetClass () 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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from 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...
 
- Static Public Member Functions inherited from Object
static const helpers::ClassgetStaticClass ()
 
static const log4cxx::helpers::ClassRegistrationregisterClass ()
 
- Protected Member Functions inherited from 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 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...
 
- Protected Attributes inherited from ObjectImpl
unsigned int volatile ref
 

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::helpers::Pool pool,
const LevelPtr level 
)

The root logger names itself as "root".

However, the root logger cannot be retrieved by name.

Member Function Documentation

virtual const LevelPtr& getEffectiveLevel ( ) const
virtual

Return the assigned level value without walking the logger hierarchy.

Reimplemented from Logger.

void 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 Logger.


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