1 #ifndef socketAppender_HPP 2 #define socketAppender_HPP 1 4 #include <rtt/TaskContext.hpp> 5 #include <rtt/Property.hpp> 6 #include <rtt/InputPort.hpp> 7 #include "LoggingEvent.hpp" 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");
41 :
public RTT::TaskContext
47 virtual bool configureHook();
48 virtual void updateHook();
49 virtual void cleanupHook();
51 log4cxx::helpers::Pool p;
52 log4cxx::net::SocketAppender * socketAppender;
53 log4cxx::helpers::InetAddressPtr address;
57 RTT::InputPort<OCL::logging::LoggingEvent>
log_port;
Interoperability component which translates our log4cpp events to log4cxx events and sends them to a ...
int maxEventsPerCycle_prop
Property to set maximum number of log events to pop per cycle.
int maxEventsPerCycle
Maximum number of log events to pop per cycle.
The Orocos Component Library.
RTT::InputPort< OCL::logging::LoggingEvent > log_port
Port we receive logging events on Initially unconnected.
int port_prop
The port where the logging server runs.
std::string hostname_prop
Name of host to append to.