Sends LoggingEvent objects to a set remote a log servers, usually a SocketNode.

Acts just like SocketAppender except that instead of connecting to a given remote log server, SocketHubAppender accepts connections from the remote log servers as clients. It can accept more than one connection, and when a log event is handled, the event is sent to the set of currently connected remote log servers. Implemented this way it does not require any update to the configuration file to send data to another remote log server. The remote log server simple connects to the host and port the SocketHubAppender is running on.

However, given the nature of accepting connections on-the-fly, it cannot be guaranteed that all events will be received while the tcp connection is in process. But once connected, it should behave the same as SocketAppender.

This implementation borrows heavily from the SocketAppender implementation as an example.

The SocketHubAppender has the following properties:

On the other hand, if the network link is up, but the server is down, the client will not be blocked when making log requests but the log events will be lost due to server unavailability.

To avoid lost data, it is usually sufficient to close the SocketHubAppender either explicitly or by calling the shutdown method before exiting the application.

SocketHubAppender (last edited 2011-09-08 16:17:35 by static-58-108-220-236)