org.apache.avalon.excalibur.logger.util
Class LoggerSwitch
java.lang.Object
org.apache.avalon.excalibur.logger.util.LoggerSwitch
- public class LoggerSwitch
- extends java.lang.Object
A proxy logger that switches between two underlying loggers
with recursive invocation detection.
This class is intended to be used by o.a.a.e.logger.AbstractLoggerManager.
all the logger switching is done in it during the "warm-up" phase
(constructor, enableLogging, contextualize, configure, start).
All these operations are held our on a single thread and the
object is not exposed to other threads untill (in strict synchronization
sense) it has been fully configured. That's why there is no synchronization
in this class. If the switching was to occur in a mulitythreaded
fasion we would have to synchronize access to m_fallback and m_preferred.
- Author:
- Avalon Development Team
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SHARED_NULL
protected static final Logger SHARED_NULL
LoggerSwitch
public LoggerSwitch(Logger fallback)
LoggerSwitch
public LoggerSwitch(Logger fallback,
Logger preferred)
get
public Logger get()
- We create a logger with no methods for changing
m_fallback and m_preferred for security reasons.
All the control is done by the parent class
that does not implement Logger itself.
setFallback
public void setFallback(Logger fallback)
setPreferred
public void setPreferred(Logger preferred)
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.