|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.MemoryTarget
Output LogEvents into an buffer in memory. At a later stage these LogEvents can be forwarded or pushed to another target. This pushing is triggered when buffer is full, the priority of a LogEvent reaches a threshold or when another class calls the push method. This is based on specification of MemoryHandler in Logging JSR47.
Constructor Summary | |
MemoryTarget(LogTarget target,
int size,
Priority threshold)
Creation of a new instance of the memory target. |
Method Summary | |
protected void |
doProcessEvent(LogEvent event)
Process a log event, via formatting and outputting it. |
boolean |
isFull()
Check if memory buffer is full. |
void |
push()
Push log events to target. |
protected void |
setOverwrite(boolean overwrite)
Set flag indicating whether it is valid to overwrite memory buffer. |
protected boolean |
shouldPush(LogEvent event)
Determine if LogEvent should initiate a push to target. |
Methods inherited from class org.apache.log.output.AbstractTarget |
close, getErrorHandler, isOpen, open, processEvent, setErrorHandler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MemoryTarget(LogTarget target, int size, Priority threshold)
target
- the target to push LogEvents tosize
- the event buffer sizethreshold
- the priority at which to push LogEvents to next LogTargetMethod Detail |
protected void setOverwrite(boolean overwrite)
overwrite
- true if buffer should overwrite logevents in buffer, false otherwiseprotected void doProcessEvent(LogEvent event)
doProcessEvent
in class AbstractTarget
event
- the log eventpublic final boolean isFull()
protected boolean shouldPush(LogEvent event)
event
- the incoming LogEvent
public void push()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |