Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
socketappenderskeleton.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _LOG4CXX_NET_SOCKET_APPENDER_SKELETON_H
19#define _LOG4CXX_NET_SOCKET_APPENDER_SKELETON_H
20
23
24
25namespace LOG4CXX_NS
26{
27
28namespace net
29{
30
80class LOG4CXX_EXPORT SocketAppenderSkeleton : public AppenderSkeleton
81{
82 protected:
83 struct SocketAppenderSkeletonPriv;
84
85 public:
86 SocketAppenderSkeleton(int defaultPort, int reconnectionDelay);
88
92 SocketAppenderSkeleton(const helpers::InetAddressPtr& address, int port, int reconnectionDelay);
96 SocketAppenderSkeleton(const LogString& host, int port, int reconnectionDelay);
97
104 void activateOptions( ) override;
105
106 void close() override;
107
113 void setRemoteHost(const LogString& host);
114
118 const LogString& getRemoteHost() const;
119
124 void setPort(int port1);
125
129 int getPort() const;
130
136 void setLocationInfo(bool locationInfo1);
137
141 bool getLocationInfo() const;
142
152 void setReconnectionDelay(int reconnectionDelay1);
153
158
162 void setSocketSubclass(const LogString& newSubclass);
163
168
187 void setOption(const LogString& option, const LogString& value) override;
188
189 protected:
190 SocketAppenderSkeleton(std::unique_ptr<SocketAppenderSkeletonPriv> priv);
191
192 virtual int getDefaultDelay() const = 0;
193
194 virtual int getDefaultPort() const = 0;
195
196 private:
197
200
201}; // class SocketAppenderSkeleton
202} // namespace net
203} // namespace log4cxx
204
205#endif // _LOG4CXX_NET_SOCKET_APPENDER_SKELETON_H
206
AppenderSkeleton(LOG4CXX_PRIVATE_PTR(AppenderSkeletonPrivate) priv)
void close() override
Release any resources allocated within the appender such as file handles, network connections,...
const LogString & getSocketSubclass() const
The class name used for the helpers::Socket interface implemention.
void activateOptions() override
Activate the options that were previously set with calls to option setters.
SocketAppenderSkeleton(int defaultPort, int reconnectionDelay)
SocketAppenderSkeleton(std::unique_ptr< SocketAppenderSkeletonPriv > priv)
SocketAppenderSkeleton(const LogString &host, int port, int reconnectionDelay)
Connects to remote server at host and port.
bool getLocationInfo() const
Returns value of the LocationInfo option.
int getReconnectionDelay() const
Returns value of the ReconnectionDelay option.
void setPort(int port1)
The Port option takes a positive integer representing the port where the server is waiting for connec...
int getPort() const
Returns value of the Port option.
void setReconnectionDelay(int reconnectionDelay1)
The ReconnectionDelay option takes a positive integer representing the number of milliseconds to wait...
void setSocketSubclass(const LogString &newSubclass)
Use newSubclass as the helpers::Socket interface instead of the default implementation.
void setRemoteHost(const LogString &host)
The RemoteHost option takes a string value which should be the host name of the server where a Apache...
const LogString & getRemoteHost() const
Returns value of the RemoteHost option.
SocketAppenderSkeleton(const helpers::InetAddressPtr &address, int port, int reconnectionDelay)
Connects to remote server at address and port.
void setOption(const LogString &option, const LogString &value) override
Set option to value.
virtual int getDefaultDelay() const =0
void setLocationInfo(bool locationInfo1)
The LocationInfo option takes a boolean value.
virtual int getDefaultPort() const =0
virtual void activateOptions()=0
Activate the options that were previously set with calls to option setters.
std::basic_string< logchar > LogString
Definition logstring.h:51