Log4cxxAppender.hpp
Go to the documentation of this file.
1 #ifndef socketAppender_HPP
2 #define socketAppender_HPP 1
3 
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>
13 
14 #if 0
15 int main() {
16  log4cxx::Log4cxxAppender * socketAppender = new
17 log4cxx::Log4cxxAppender(log4cxx::LayoutPtr(new log4cxx::SimpleLayout()),
18 "logfile", false);
19 
20  log4cxx::helpers::Pool p;
21  socketAppender->activateOptions(p);
22 
23  log4cxx::BasicConfigurator::configure(log4cxx::AppenderPtr(socketAppender));
24  log4cxx::Logger::getRootLogger()->setLevel(log4cxx::Level::getDebug());
25  log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger("logger");
26 
27  LOG4CXX_INFO(logger,"Created Log4cxxAppender appender");
28 
29  return 0;
30 }
31 #endif
32 
33 namespace OCL {
34 namespace logging {
35 
41  : public RTT::TaskContext
42 {
43 public:
44  Log4cxxAppender(std::string name);
45  virtual ~Log4cxxAppender();
46 protected:
47  virtual bool configureHook();
48  virtual void updateHook();
49  virtual void cleanupHook();
50 
51  log4cxx::helpers::Pool p;
52  log4cxx::net::SocketAppender * socketAppender;
53  log4cxx::helpers::InetAddressPtr address;
54 
58 
60  std::string hostname_prop;
61 
63  int port_prop;
68 
79 };
80 
81 // namespaces
82 }
83 }
84 
85 #endif
log4cxx::helpers::InetAddressPtr address
std::string hostname_prop
Name of host to append to.
int main(int argc, char **argv)
Definition: cdeployer.cpp:55
log4cxx::helpers::Pool p
RTT::InputPort< OCL::logging::LoggingEvent > log_port
int port_prop
The port where the logging server runs.
log4cxx::net::SocketAppender * socketAppender


ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27