de.unkrig.commons.util.logging.handler
Class EagerHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by de.unkrig.commons.util.logging.handler.ProxyHandler
          extended by de.unkrig.commons.util.logging.handler.EagerHandler

public class EagerHandler
extends ProxyHandler

A Handler that formats its message immediately and forwards it to a delegate. This is useful if mutable objects are used as log record parameters, and the delegate handler formats messages with a delay (like MemoryHandler.

This may cause noticable costs if the objects' ObjectObject.toString() methods are expensive and/or return large strings.


Constructor Summary
EagerHandler()
           
EagerHandler(java.lang.String propertyNamePrefix)
           
 
Method Summary
 void publish(java.util.logging.LogRecord record)
           
 
Methods inherited from class de.unkrig.commons.util.logging.handler.ProxyHandler
close, flush, getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setDelegate, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.util.logging.Handler
reportError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EagerHandler

public EagerHandler()
             throws ParseException,
                    EvaluationException
Throws:
ParseException
EvaluationException

EagerHandler

public EagerHandler(@Nullable
                    java.lang.String propertyNamePrefix)
             throws ParseException,
                    EvaluationException
Throws:
ParseException
EvaluationException
Method Detail

publish

public void publish(java.util.logging.LogRecord record)
Overrides:
publish in class ProxyHandler