public class EventHandler extends Handler
Modifier and Type | Field and Description |
---|---|
protected static String |
DISABLE_DUMP_COMPR_PROP |
protected static String |
DISABLE_DUMPS_PROP |
protected static long |
FILE_EXPN_TIME_MS |
protected static long |
LOG_BUFFER_SIZE |
protected static String |
LOG_DUMP_COMP_EXT |
protected static String |
LOG_DUMP_FILE_EXT |
protected static String |
LOG_DUMP_FILE_NAME |
protected static String |
MAX_NUM_DUMP_FILES_PROP |
protected static String |
MAX_SIZE_DUMPS_MB_PROP |
protected static String |
THROTTLE_DURATION_PROP |
protected static String |
THROTTLE_LIMIT_PROP |
Constructor and Description |
---|
EventHandler(int maxEntries,
int flushPeriodMs) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupSfDumps(boolean deleteOldest)
Function to remove old Snowflake Dump files to make room for new ones.
|
void |
close() |
void |
dumpLogBuffer(String identifier)
Dumps the contents of the in-memory log buffer to disk and clears the buffer.
|
void |
flush()
Flushes all eventBuffer entries.
|
int |
getBufferSize()
Returns current size of the event buffer
|
long |
getLogBufferSize()
Returns the current size of the log buffer
|
void |
publish(LogRecord record)
Overridden Logger.Handler publish(...) method.
|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
protected static final long LOG_BUFFER_SIZE
protected static final long FILE_EXPN_TIME_MS
protected static final String LOG_DUMP_FILE_NAME
protected static final String LOG_DUMP_FILE_EXT
protected static final String LOG_DUMP_COMP_EXT
protected static final String THROTTLE_DURATION_PROP
protected static final String THROTTLE_LIMIT_PROP
protected static final String DISABLE_DUMPS_PROP
protected static final String MAX_NUM_DUMP_FILES_PROP
protected static final String MAX_SIZE_DUMPS_MB_PROP
protected static final String DISABLE_DUMP_COMPR_PROP
public int getBufferSize()
public long getLogBufferSize()
public void dumpLogBuffer(String identifier)
identifier
- event idprotected void cleanupSfDumps(boolean deleteOldest)
deleteOldest
- if true, always deletes the oldest file found if max
number of dump files has been reachedpublic void publish(LogRecord record)
Copyright © 2017. All rights reserved.