1 #ifndef socketAppender_HPP 2 #define socketAppender_HPP 1 8 #include <log4cxx/logger.h> 9 #include <log4cxx/helpers/pool.h> 10 #include <log4cxx/basicconfigurator.h> 11 #include <log4cxx/net/socketappender.h> 12 #include <log4cxx/simplelayout.h> 16 log4cxx::Log4cxxAppender * socketAppender =
new 17 log4cxx::Log4cxxAppender(log4cxx::LayoutPtr(
new log4cxx::SimpleLayout()),
20 log4cxx::helpers::Pool p;
21 socketAppender->activateOptions(p);
23 log4cxx::BasicConfigurator::configure(log4cxx::AppenderPtr(socketAppender));
24 log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getDebug());
25 log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(
"logger");
27 LOG4CXX_INFO(logger,
"Created Log4cxxAppender appender");
51 log4cxx::helpers::Pool
p;
Log4cxxAppender(std::string name)
int maxEventsPerCycle_prop
log4cxx::helpers::InetAddressPtr address
virtual bool configureHook()
virtual void cleanupHook()
std::string hostname_prop
Name of host to append to.
virtual ~Log4cxxAppender()
int main(int argc, char **argv)
RTT::InputPort< OCL::logging::LoggingEvent > log_port
int port_prop
The port where the logging server runs.
virtual void updateHook()
log4cxx::net::SocketAppender * socketAppender