Class SyslogTcpPublisher
- java.lang.Object
-
- org.forgerock.openam.log.handlers.syslog.SyslogPublisher
-
- org.forgerock.openam.log.handlers.syslog.SyslogTcpPublisher
-
public class SyslogTcpPublisher extends SyslogPublisher
ASyslogPublisherimplementation that publishes the audit log records using the TCP protocol.
-
-
Field Summary
-
Fields inherited from class org.forgerock.openam.log.handlers.syslog.SyslogPublisher
socketAddress
-
-
Constructor Summary
Constructors Constructor Description SyslogTcpPublisher(InetSocketAddress socketAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcloseConnection()Closes the underlying connection.protected voidreconnect()Checks if the currently opened connection is still valid, and connects/reconnects to the Syslog server if necessary.protected voidsendLogRecord(byte[] bytes)Sends the log record to Syslog over TCP in the correct format.-
Methods inherited from class org.forgerock.openam.log.handlers.syslog.SyslogPublisher
publishLogRecords
-
-
-
-
Constructor Detail
-
SyslogTcpPublisher
public SyslogTcpPublisher(InetSocketAddress socketAddress)
-
-
Method Detail
-
reconnect
protected void reconnect() throws IOExceptionDescription copied from class:SyslogPublisherChecks if the currently opened connection is still valid, and connects/reconnects to the Syslog server if necessary.- Specified by:
reconnectin classSyslogPublisher- Throws:
IOException- If there was an IO error while trying to connect to the Syslog server.
-
sendLogRecord
protected void sendLogRecord(byte[] bytes) throws IOExceptionSends the log record to Syslog over TCP in the correct format. Per RFC 6587 the TCP messages should have the following structure:
Additionally RFC 5424 defines the followings:SYSLOG-FRAME = MSG-LEN SP SYSLOG-MSG MSG-LEN = NONZERO-DIGIT *DIGIT NONZERO-DIGIT = %d49-57DIGIT = %d48 / NONZERO-DIGIT SP = %d32- Specified by:
sendLogRecordin classSyslogPublisher- Parameters:
bytes- The log record's byte[] representation.- Throws:
IOException- If there was an IO error while sending the audit entry to Syslog.
-
closeConnection
protected void closeConnection() throws IOExceptionDescription copied from class:SyslogPublisherCloses the underlying connection.- Specified by:
closeConnectionin classSyslogPublisher- Throws:
IOException- If there was an IO error while closing the connection.
-
-