intarsys runtime library

de.intarsys.tools.logging
Class LogHandlerSwitcher

java.lang.Object
  extended by de.intarsys.tools.logging.LogHandlerSwitcher

public class LogHandlerSwitcher
extends Object

A tool class that provides the mechanics for a thread context sensitive log handler attached to a dedicated Logger. By default, the handler is attached to the root logger.


Constructor Summary
LogHandlerSwitcher()
           
 
Method Summary
 void attach()
          Attach the handler to the current thread.
 void destroy()
           
 void detach()
          Detach the handler from the current thread.
 Handler getHandler()
           
 Handler getHandlerAttached()
           
 Handler getHandlerDetached()
           
 IHandlerFactory getHandlerFactory()
           
 String getLoggerName()
           
 void init()
           
 boolean isHandlerPerAttach()
           
 void setHandlerFactory(IHandlerFactory logHandlerFactory)
           
 void setHandlerPerAttach(boolean logPerRequest)
           
 void setLoggerName(String loggerName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogHandlerSwitcher

public LogHandlerSwitcher()
Method Detail

attach

public void attach()
Attach the handler to the current thread.


destroy

public void destroy()

detach

public void detach()
Detach the handler from the current thread.


getHandler

public Handler getHandler()

getHandlerAttached

public Handler getHandlerAttached()

getHandlerDetached

public Handler getHandlerDetached()

getHandlerFactory

public IHandlerFactory getHandlerFactory()

getLoggerName

public String getLoggerName()

init

public void init()
          throws IOException
Throws:
IOException

isHandlerPerAttach

public boolean isHandlerPerAttach()

setHandlerFactory

public void setHandlerFactory(IHandlerFactory logHandlerFactory)

setHandlerPerAttach

public void setHandlerPerAttach(boolean logPerRequest)

setLoggerName

public void setLoggerName(String loggerName)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.