Class SyslogHandler


  • public class SyslogHandler
    extends Handler
    The SyslogHandler publishes log records using default formatter (SyslogFormatter) and sends these to a syslog daemon using SyslogPublisher. The publisher is initialized once, during initialization of SyslogHandler object and flushed after each write.
    • Constructor Detail

      • SyslogHandler

        public SyslogHandler​(String name)
        Initialize SyslogHandler for logger "name".
        Parameters:
        name - is ignored.
    • Method Detail

      • flush

        public void flush()
        Flushes the buffered logrecords.
        Specified by:
        flush in class Handler
      • close

        public void close()
        Flushes the buffered logrecords and closes the connections established by SyslogPublisher.
        Specified by:
        close in class Handler
      • publish

        public void publish​(LogRecord logRecord)
        Publishes the log record if it is loggable according to current configuration.
        Specified by:
        publish in class Handler
        Parameters:
        logRecord - A LogRecord which is formatted using the configured formatter, converted to byte array and sent to an outputstream managed by this handler.