Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
com/foo/config1.cpp

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 {
using namespace log4cxx;
static struct log4cxx_initializer {
log4cxx_initializer() {
// Set up a simple configuration that logs on the console.
}
~log4cxx_initializer() {
}
} initAndShutdown;
return name.empty()
}
} } // namespace com::foo
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, const spi::LoggerFactoryPtr &factory={})
Retrieve the name Logger instance from the LoggerRepository using factory to create it if required.
static void shutdown()
Safely close and remove all appenders in all loggers including the root logger.
Definition configuration.h:26