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 to the root logger that formats output using layout.
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 DefaultLoggerFactory to create it i...
static void shutdown()
Safely close and remove all appenders in all loggers including the root logger.