public class QueueHandler extends ExtHandler
handlers, handlersUpdater
Constructor and Description |
---|
QueueHandler()
Construct a new instance with a default queue length.
|
QueueHandler(int limit)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doPublish(ExtLogRecord record)
Do the actual work of publication; the record will have been filtered already.
|
int |
getLimit()
Get the queue length limit.
|
ExtLogRecord[] |
getQueue()
Get a copy of the queue as it is at an exact moment in time.
|
String[] |
getQueueAsStrings()
Get a copy of the queue, rendering each record as a string.
|
void |
publish(ExtLogRecord record)
Publish an
ExtLogRecord . |
void |
publish(LogRecord record) |
void |
replay()
Replay the stored queue to the nested handlers.
|
void |
setLimit(int limit)
Set the queue length limit.
|
addHandler, checkAccess, checkAccess, clearHandlers, close, disableAccess, enableAccess, flush, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setEncoding, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
public QueueHandler()
public QueueHandler(int limit)
limit
- the queue length to usepublic void publish(ExtLogRecord record)
ExtHandler
ExtLogRecord
.
The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.
The ExtHandler
is responsible for formatting the message, when and if necessary. The formatting should
include localization.publish
in class ExtHandler
record
- the log record to publishpublic void publish(LogRecord record)
ExtHandler
publish
in class ExtHandler
protected void doPublish(ExtLogRecord record)
ExtHandler
autoFlush
property is set to true
; if this behavior is to be
preserved in a subclass then this method should be called after the record is physically written.doPublish
in class ExtHandler
record
- the log record to publishpublic int getLimit()
public void setLimit(int limit)
limit
- the queue length limitpublic ExtLogRecord[] getQueue()
public String[] getQueueAsStrings()
public void replay()
Copyright © 2019 JBoss by Red Hat. All rights reserved.