A socket appender transmits logger messages to a port on a remote host. On the remote host, the messages can then be logged as if generated locally. Using a socket appender allows you to send logs from various systems to a single server where all logs for your organization are monitored or stored.
To use a socket appender, you must define a socket server to receive the log messages. Log4j® includes socket server examples as part of its distribution.
Whether you are defining a socket appender for system logging or audit logging, the settings shown in the following image are the same.

Socket Appender Information
The following table describes the fields in the Socket Appender Information section of the Appender screen.
Field
|
Description
|
Remote Host
|
The name or IP address of the server to which the logging events should be sent.
|
Port
|
The port number on the remote host to which the logging events should be sent.
|
Reconnection Delay
|
The number of milliseconds to wait between each failed attempt to connect to the server using the specified port. The default is 30000 milliseconds (30 seconds).
If you set this field to zero (0), the socket appender attempts to connect to the server only once. If the connection fails, TeamConnect does not try to reconnect.
|
Include Location Information
|
Select this option to include the location information in the logging events placed in the buffer.
Location information includes the file name where the logging request was issued, the line number in the file, the class name, and the method name from which the message was logged.
If this option is not selected, then the location information is replaced with a question mark (?) in the log. However, it can help reduce the generation time of the logging events.
|
|
For general instructions on defining all types of appenders, see one of the following:
•For system logging, see Defining System Appenders.
•For audit logging, see Defining Audit Appenders.