Class EventHandler


  • public class EventHandler
    extends Handler
    Author:
    jrosen
    • Constructor Detail

      • EventHandler

        public EventHandler​(int maxEntries,
                            int flushPeriodMs)
    • Method Detail

      • getBufferSize

        public int getBufferSize()
        Returns current size of the event buffer
        Returns:
        size of eventBuffer
      • getLogBufferSize

        public long getLogBufferSize()
        Returns the current size of the log buffer
        Returns:
        size of log buffer
      • dumpLogBuffer

        public void dumpLogBuffer​(String identifier)
        Dumps the contents of the in-memory log buffer to disk and clears the buffer.
        Parameters:
        identifier - event id
      • cleanupSfDumps

        protected void cleanupSfDumps​(boolean deleteOldest)
        Function to remove old Snowflake Dump files to make room for new ones.
        Parameters:
        deleteOldest - if true, always deletes the oldest file found if max number of dump files has been reached
      • flush

        public void flush()
        Flushes all eventBuffer entries.
        Specified by:
        flush in class Handler
      • publish

        public void publish​(LogRecord record)
        Overridden Logger.Handler publish(...) method. Buffers unformatted log records in memory in a circular buffer-like fashion.
        Specified by:
        publish in class Handler
        Parameters:
        record - log record
      • close

        public void close()
        Specified by:
        close in class Handler