Apache Log4cxx  Version 1.6.1
Loading...
Searching...
No Matches
MyApp2.cpp

This example can be built with com/foo/config2.cpp or com/foo/config4.cpp to configure Log4cxx on the first call the com::foo::getLogger.

#include "com/foo/config.h"
#include "com/foo/bar.h"
int main(int argc, char **argv) {
int result = EXIT_SUCCESS;
try {
auto logger = com::foo::getLogger("MyApp");
LOG4CXX_INFO(logger, "Entering application.");
com::foo::Bar bar;
bar.doIt();
LOG4CXX_INFO(logger, "Exiting application.");
}
catch(std::exception&) {
result = EXIT_FAILURE;
}
return result;
}
#define LOG4CXX_INFO(logger, message)
Add a new logging event containing message to attached appender(s) if logger is enabled for INFO even...
Definition log4cxx/logger.h:2386