Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members | Related Pages

XMLSocketAppender Class Reference

Inheritance diagram for XMLSocketAppender:

AppenderSkeleton Appender ObjectImpl OptionHandler Object Object List of all members.

Public Member Functions

 XMLSocketAppender (unsigned long address, int port)
 XMLSocketAppender (const String &host, int port)
void activateOptions ()
virtual void setOption (const String &option, const String &value)
void close ()
void cleanUp ()
virtual void append (const spi::LoggingEventPtr &event)
bool requiresLayout () const
void setRemoteHost (const String &host)
const String & getRemoteHost () const
void setPort (int port)
int getPort () const
void setLocationInfo (bool locationInfo)
bool getLocationInfo () const
void setReconnectionDelay (int reconnectionDelay)
int getReconnectionDelay () const

Static Public Attributes

int DEFAULT_PORT = 4560
int DEFAULT_RECONNECTION_DELAY = 30000

Protected Attributes

String remoteHost
helpers::InetAddress address

Static Protected Attributes

const int MAX_EVENT_LEN = 1024

Detailed Description

Sends LoggingEvent objects in XML format to a remote a log server, usually a XMLSocketNode.

The XMLSocketAppender has the following properties:


Constructor & Destructor Documentation

XMLSocketAppender unsigned long  address,
int  port
 

Connects to remote server at address and port.

XMLSocketAppender const String &  host,
int  port
 

Connects to remote server at host and port.


Member Function Documentation

void activateOptions  )  [virtual]
 

Connect to the specified RemoteHost and Port.

Reimplemented from AppenderSkeleton.

void append const spi::LoggingEventPtr event  )  [virtual]
 

Subclasses of AppenderSkeleton should implement this method to perform actual logging. See also AppenderSkeleton::doAppend method.

Implements AppenderSkeleton.

void cleanUp  ) 
 

Drop the connection to the remote host and release the underlying connector thread if it has been created

void close  )  [virtual]
 

Close this appender.

This will mark the appender as closed and call then cleanUp method.

Implements Appender.

bool getLocationInfo  )  const [inline]
 

Returns value of the LocationInfo option.

int getPort  )  const [inline]
 

Returns value of the Port option.

int getReconnectionDelay  )  const [inline]
 

Returns value of the ReconnectionDelay option.

const String& getRemoteHost  )  const [inline]
 

Returns value of the RemoteHost option.

bool requiresLayout  )  const [inline, virtual]
 

The XMLSocketAppender use an internal XMLLayout. Hence, this method returns false.

Implements Appender.

void setLocationInfo bool  locationInfo  )  [inline]
 

The LocationInfo option takes a boolean value. If true, the information sent to the remote host will include location information. By default no location information is sent to the server.

void setOption const String &  option,
const String &  value
[virtual]
 

Set options

Reimplemented from AppenderSkeleton.

void setPort int  port  )  [inline]
 

The Port option takes a positive integer representing the port where the server is waiting for connections.

void setReconnectionDelay int  reconnectionDelay  )  [inline]
 

The ReconnectionDelay option takes a positive integer representing the number of milliseconds to wait between each failed connection attempt to the server. The default value of this option is 30000 which corresponds to 30 seconds.

Setting this option to zero turns off reconnection capability.

void setRemoteHost const String &  host  )  [inline]
 

The RemoteHost option takes a string value which should be the host name of the server where an XMLSocketNode is running.


Member Data Documentation

helpers::InetAddress address [protected]
 

IP address

int DEFAULT_PORT = 4560 [static]
 

The default port number of remote logging server (4560).

int DEFAULT_RECONNECTION_DELAY = 30000 [static]
 

The default reconnection delay (30000 milliseconds or 30 seconds).

const int MAX_EVENT_LEN = 1024 [static, protected]
 

An event XML stream cannot exceed 1024 bytes.

String remoteHost [protected]
 

host name


The documentation for this class was generated from the following files:
Generated on Tue Nov 14 14:55:20 2006 for log4cxx by  doxygen 1.3.9.1