log4cplus  2.0.5
log4judpappender.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Module: LOG4CPLUS
3 // File: log4judpappender.h
4 // Created: 7/2012
5 // Author: Siva Chandran P
6 //
7 //
8 // Copyright 2012-2017 Siva Chandran P
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 
24 #ifndef LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
25 #define LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
26 
27 #include <log4cplus/config.hxx>
28 #include <log4cplus/appender.h>
30 
31 namespace log4cplus {
32 
62  public:
63  // Ctors
64  Log4jUdpAppender(const log4cplus::tstring& host, int port,
65  bool ipv6 = false);
67 
68  // Dtor
70 
71  // Methods
72  virtual void close();
73 
74  protected:
75  void openSocket();
76  virtual void append(const spi::InternalLoggingEvent& event);
77 
78  // Data
81  int port;
82  bool ipv6 = false;
83 
84  private:
85  // Disallow copying of instances of this class
87  Log4jUdpAppender& operator=(const Log4jUdpAppender&);
88  };
89 } // end namespace log4cplus
90 
91 #endif // LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
log4cplus::helpers::Socket
This class implements client sockets (also called just "sockets").
Definition: helpers/socket.h:84
log4cplus::Log4jUdpAppender::~Log4jUdpAppender
~Log4jUdpAppender()
log4cplus
Definition: appender.h:46
log4cplus::tstring
std::basic_string< tchar > tstring
Definition: tstring.h:39
log4cplus::Log4jUdpAppender::openSocket
void openSocket()
log4cplus::Log4jUdpAppender::Log4jUdpAppender
Log4jUdpAppender(const log4cplus::helpers::Properties &properties)
config.hxx
log4cplus::helpers::Properties
Definition: property.h:43
socket.h
log4cplus::Log4jUdpAppender
Sends log events as Log4j XML to a remote a log server.
Definition: log4judpappender.h:61
log4cplus::Log4jUdpAppender::close
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
log4cplus::Log4jUdpAppender::host
log4cplus::tstring host
Definition: log4judpappender.h:80
log4cplus::Log4jUdpAppender::Log4jUdpAppender
Log4jUdpAppender(const log4cplus::tstring &host, int port, bool ipv6=false)
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition: loggingevent.h:51
log4cplus::Log4jUdpAppender::socket
log4cplus::helpers::Socket socket
Definition: log4judpappender.h:79
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition: win32.h:141
log4cplus::Log4jUdpAppender::port
int port
Definition: log4judpappender.h:81
appender.h
log4cplus::Appender
Extend this class for implementing your own strategies for printing log statements.
Definition: appender.h:139
log4cplus::Log4jUdpAppender::append
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.