java.lang.ObjectHandler that buffers requests in a circular buffer in memory.java.util.logging.Handler
java.util.logging.MemoryHandler
Normally this Handler simply stores incoming LogRecords into its memory buffer and discards earlier records. This buffering is very cheap and avoids formatting costs. On certain trigger conditions, the MemoryHandler will push out its current buffer contents to a target Handler, which will typically publish them to the outside world.
There are three main models for triggering a push of the buffer:
Configuration: By default each MemoryHandler is initialized using the following LogManager configuration properties. If properties are not defined (or have invalid values) then the specified default values are used. If no default value is defined then a RuntimeException is thrown.
1.4 - | Field Summary | ||
|---|---|---|
| int | start | |
| int | count | |
| Fields inherited from java.util.logging.Handler: |
|---|
| sealed |
| Constructor: |
|---|
|
The MemoryHandler is configured based on LogManager properties (or their default values) except that the given pushLevel argument and buffer size argument are used.
|
| Method from java.util.logging.MemoryHandler Summary: |
|---|
| close, flush, getPushLevel, isLoggable, publish, push, setPushLevel |
| Methods from java.util.logging.Handler: |
|---|
| checkAccess, close, flush, getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, publish, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel |
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from java.util.logging.MemoryHandler Detail: |
|---|
|
Note that the current contents of the MemoryHandler buffer are not written out. That requires a "push". |
|
This method checks if the LogRecord has an appropriate level and whether it satisfies any Filter. However it does not check whether the LogRecord would result in a "push" of the buffer contents. It will return false if the LogRecord is Null. |
If there is a Filter, its isLoggable method is called to check if the given log record is loggable. If not we return. Otherwise the given record is copied into an internal circular buffer. Then the record's level property is compared with the pushLevel. If the given level is greater than or equal to the pushLevel then push is called to write all buffered records to the target output Handler. |
The buffer is then cleared. |
|