This file is a simplified example of encapsulated Log4cxx configuration.
#include "com/foo/config.h"
namespace com { namespace foo {
auto getLogger(const std::string& name) -> LoggerPtr {
static struct log4cxx_initializer {
log4cxx_initializer() {
}
~log4cxx_initializer() {
}
} initAndShutdown;
return name.empty()
}
} }
static void configure(const LayoutPtr &layout=LayoutPtr())
Add a ConsoleAppender that formats output using layout to the root logger.
static LoggerPtr getRootLogger()
Retrieve the root logger from the LoggerRepository.
static LoggerPtr getLogger(const std::string &name)
Retrieve the name Logger instance from the LoggerRepository using the default factory to create it if...
static void shutdown()
Safely close and remove all appenders in all loggers including the root logger.
Definition configuration.h:25