Apache Log4cxx  Version 1.5.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 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 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