| java.lang.Object org.apache.log.output.AbstractTarget org.apache.log.output.MemoryTarget
MemoryTarget | public class MemoryTarget extends AbstractTarget (Code) | | 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.
author: Avalon Development Team author: Peter Donald |
Method Summary | |
protected synchronized void | doProcessEvent(LogEvent event) Process a log event, via formatting and outputting it. | final public synchronized boolean | isFull() Check if memory buffer is full. | public synchronized void | push() Push log events to target. | protected synchronized void | setOverwrite(boolean overwrite) Set flag indicating whether it is valid to overwrite memory buffer. | protected synchronized boolean | shouldPush(LogEvent event) Determine if LogEvent should initiate a push to target. |
MemoryTarget | public MemoryTarget(LogTarget target, int size, Priority threshold)(Code) | | Creation of a new instance of the memory target.
Parameters: target - the target to push LogEvents to Parameters: size - the event buffer size Parameters: threshold - the priority at which to push LogEvents to next LogTarget |
doProcessEvent | protected synchronized void doProcessEvent(LogEvent event)(Code) | | Process a log event, via formatting and outputting it.
Parameters: event - the log event |
isFull | final public synchronized boolean isFull()(Code) | | Check if memory buffer is full.
true if buffer is full, false otherwise |
push | public synchronized void push()(Code) | | Push log events to target.
|
setOverwrite | protected synchronized void setOverwrite(boolean overwrite)(Code) | | Set flag indicating whether it is valid to overwrite memory buffer.
Parameters: overwrite - true if buffer should overwrite logevents in buffer, false otherwise |
shouldPush | protected synchronized boolean shouldPush(LogEvent event)(Code) | | Determine if LogEvent should initiate a push to target.
Subclasses can overide this method to change the conditions
under which a push occurs.
Parameters: event - the incoming LogEvent true if should push, false otherwise |
|
|