Class SyslogTcpPublisher


  • public class SyslogTcpPublisher
    extends SyslogPublisher
    A SyslogPublisher implementation that publishes the audit log records using the TCP protocol.
    • Constructor Detail

    • Method Detail

      • reconnect

        protected void reconnect()
                          throws IOException
        Description copied from class: SyslogPublisher
        Checks if the currently opened connection is still valid, and connects/reconnects to the Syslog server if necessary.
        Specified by:
        reconnect in class SyslogPublisher
        Throws:
        IOException - If there was an IO error while trying to connect to the Syslog server.
      • sendLogRecord

        protected void sendLogRecord​(byte[] bytes)
                              throws IOException
        Sends the log record to Syslog over TCP in the correct format. Per RFC 6587 the TCP messages should have the following structure:
         
         SYSLOG-FRAME = MSG-LEN SP SYSLOG-MSG
         MSG-LEN = NONZERO-DIGIT *DIGIT
         NONZERO-DIGIT = %d49-57
         
         
        Additionally RFC 5424 defines the followings:
         
         DIGIT = %d48 / NONZERO-DIGIT
         SP = %d32
         
         
        Specified by:
        sendLogRecord in class SyslogPublisher
        Parameters:
        bytes - The log record's byte[] representation.
        Throws:
        IOException - If there was an IO error while sending the audit entry to Syslog.