Sends LoggingEvent objects in XML format to a remote a log server, usually a XMLSocketNode. More...
Inherits log4cxx::net::SocketAppenderSkeleton.
Classes | |
class | ClazzXMLSocketAppender |
Public Member Functions | |
virtual const helpers::Class & | getClass () const |
const void * | cast (const helpers::Class &clazz) const |
bool | instanceof (const helpers::Class &clazz) const |
XMLSocketAppender () | |
~XMLSocketAppender () | |
XMLSocketAppender (helpers::InetAddressPtr address, int port) | |
Connects to remote server at address and port . | |
XMLSocketAppender (const LogString &host, int port) | |
Connects to remote server at host and port . | |
Static Public Member Functions | |
static const helpers::Class & | getStaticClass () |
static const log4cxx::helpers::ClassRegistration & | registerClass () |
Static Public Attributes | |
static int | DEFAULT_PORT |
The default port number of remote logging server (4560). | |
static int | DEFAULT_RECONNECTION_DELAY |
The default reconnection delay (30000 milliseconds or 30 seconds). | |
static const int | MAX_EVENT_LEN |
An event XML stream cannot exceed 1024 bytes. | |
Protected Member Functions | |
virtual void | setSocket (log4cxx::helpers::SocketPtr &socket, log4cxx::helpers::Pool &p) |
virtual void | cleanUp (log4cxx::helpers::Pool &p) |
virtual int | getDefaultDelay () const |
virtual int | getDefaultPort () const |
void | append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) |
Subclasses of AppenderSkeleton should implement this method to perform actual logging. |
Sends LoggingEvent objects in XML format to a remote a log server, usually a XMLSocketNode.
The XMLSocketAppender has the following properties:
XMLSocketAppender
is no longer attached to any logger, it will not be destroyed in the presence of a connector thread. A connector thread exists only if the connection to the server is down. To avoid this destruction problem, you should close the the XMLSocketAppender
explicitly. See also next item. XMLSocketAppender
instances should be aware of this destruction problem. Most other applications can safely ignore it.XMLSocketAppender
exits before the XMLSocketAppender
is closed either explicitly or subsequent to destruction, then there might be untransmitted data in the pipe which might be lost. XMLSocketAppender
either explicitly or by calling the LogManager::shutdown method before exiting the application. ~XMLSocketAppender | ( | ) |
XMLSocketAppender | ( | helpers::InetAddressPtr | address, | |
int | port | |||
) |
Connects to remote server at address
and port
.
XMLSocketAppender | ( | const LogString & | host, | |
int | port | |||
) |
Connects to remote server at host
and port
.
void append | ( | const spi::LoggingEventPtr & | event, | |
log4cxx::helpers::Pool & | p | |||
) | [protected, virtual] |
Subclasses of AppenderSkeleton
should implement this method to perform actual logging.
See also AppenderSkeleton::doAppend method.
Implements AppenderSkeleton.
const void* cast | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Implements Object.
virtual void cleanUp | ( | log4cxx::helpers::Pool & | p | ) | [protected, virtual] |
Implements SocketAppenderSkeleton.
virtual const helpers::Class& getClass | ( | ) | const [virtual] |
Reimplemented from Object.
virtual int getDefaultDelay | ( | ) | const [protected, virtual] |
Implements SocketAppenderSkeleton.
virtual int getDefaultPort | ( | ) | const [protected, virtual] |
Implements SocketAppenderSkeleton.
static const helpers::Class& getStaticClass | ( | ) | [static] |
Reimplemented from Object.
bool instanceof | ( | const helpers::Class & | clazz | ) | const [inline, virtual] |
Implements Object.
static const log4cxx::helpers::ClassRegistration& registerClass | ( | ) | [static] |
Reimplemented from Object.
virtual void setSocket | ( | log4cxx::helpers::SocketPtr & | socket, | |
log4cxx::helpers::Pool & | p | |||
) | [protected, virtual] |
Implements SocketAppenderSkeleton.
int DEFAULT_PORT [static] |
The default port number of remote logging server (4560).
int DEFAULT_RECONNECTION_DELAY [static] |
The default reconnection delay (30000 milliseconds or 30 seconds).
const int MAX_EVENT_LEN [static] |
An event XML stream cannot exceed 1024 bytes.