com.neeve.trace
Class TraceLoggerFactory.ForkHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by com.neeve.trace.TraceLoggerFactory.ForkHandler
Enclosing class:
TraceLoggerFactory

public static final class TraceLoggerFactory.ForkHandler
extends Handler

Implements a 'fork' trace handler.

This handler forks trace log records to two downstream handlers. Log records are only forwarded by fork handlers if they pass any installed filters and level checks.


Constructor Summary
TraceLoggerFactory.ForkHandler(Handler handler1, Handler handler2)
          Construct using the downstream handlers.
 
Method Summary
 void close()
          Implementation of Handler.close()
 void flush()
          Implementation of Handler.flush()
 void publish(LogRecord record)
          Implementation of Handler.publish(java.util.logging.LogRecord)
 void setFormatter(Formatter formatter)
          Overriden implementation of Handler.setFormatter(java.util.logging.Formatter) This method sets the formatter of the downstream handler.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setEncoding, setErrorManager, setFilter, setLevel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraceLoggerFactory.ForkHandler

public TraceLoggerFactory.ForkHandler(Handler handler1,
                                      Handler handler2)
Construct using the downstream handlers.

Parameters:
handler1 - The first downstream handler
handler2 - The second downstream handler
Method Detail

setFormatter

public final void setFormatter(Formatter formatter)
Overriden implementation of Handler.setFormatter(java.util.logging.Formatter)

This method sets the formatter of the downstream handler. The method does not affect the formatter of handlers in the watcher list.

Overrides:
setFormatter in class Handler

publish

public final void publish(LogRecord record)
Implementation of Handler.publish(java.util.logging.LogRecord)

Specified by:
publish in class Handler

flush

public final void flush()
Implementation of Handler.flush()

Specified by:
flush in class Handler

close

public final void close()
Implementation of Handler.close()

Specified by:
close in class Handler


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.