log4judpappender.h
Go to the documentation of this file.
// -*- C++ -*-
// Module: LOG4CPLUS
// File: log4judpappender.h
// Created: 7/2012
// Author: Siva Chandran P
//
//
// Copyright 2012-2017 Siva Chandran P
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
#define LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
#include <log4cplus/config.hxx>
#include <log4cplus/appender.h>
#include <log4cplus/helpers/socket.h>
namespace log4cplus {
class LOG4CPLUS_EXPORT Log4jUdpAppender : public Appender {
public:
// Ctors
Log4jUdpAppender(const log4cplus::tstring& host, int port,
bool ipv6 = false);
Log4jUdpAppender(const log4cplus::helpers::Properties & properties);
// Dtor
~Log4jUdpAppender();
// Methods
virtual void close();
protected:
void openSocket();
virtual void append(const spi::InternalLoggingEvent& event);
// Data
log4cplus::helpers::Socket socket;
log4cplus::tstring host;
int port;
bool ipv6 = false;
private:
// Disallow copying of instances of this class
Log4jUdpAppender(const Log4jUdpAppender&);
Log4jUdpAppender& operator=(const Log4jUdpAppender&);
};
} // end namespace log4cplus
#endif // LOG4CPLUS_LOG4J_UDP_APPENDER_HEADER_
appender.h
log4cplus::Appender::Appender
Appender()
log4cplus::Log4jUdpAppender::append
virtual void append(const spi::InternalLoggingEvent &event)
Subclasses of Appender should implement this method to perform actual logging.
log4cplus::Log4jUdpAppender::host
log4cplus::tstring host
Definition log4judpappender.h:80
log4cplus::Log4jUdpAppender::Log4jUdpAppender
Log4jUdpAppender(const log4cplus::tstring &host, int port, bool ipv6=false)
log4cplus::Log4jUdpAppender::~Log4jUdpAppender
~Log4jUdpAppender()
log4cplus::Log4jUdpAppender::Log4jUdpAppender
Log4jUdpAppender(const log4cplus::helpers::Properties &properties)
log4cplus::Log4jUdpAppender::ipv6
bool ipv6
Definition log4judpappender.h:82
log4cplus::Log4jUdpAppender::socket
log4cplus::helpers::Socket socket
Definition log4judpappender.h:79
log4cplus::Log4jUdpAppender::close
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
log4cplus::Log4jUdpAppender::port
int port
Definition log4judpappender.h:81
log4cplus::Log4jUdpAppender::openSocket
void openSocket()
log4cplus::helpers::Properties
Definition property.h:43
log4cplus::helpers::Socket
This class implements client sockets (also called just "sockets").
Definition helpers/socket.h:84
log4cplus::spi::InternalLoggingEvent
The internal representation of logging events.
Definition loggingevent.h:51
config.hxx
socket.h
log4cplus
Definition appender.h:46
log4cplus::tstring
std::basic_string< tchar > tstring
Definition tstring.h:39
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition win32.h:141