Package org.apache.juli
Class ClassLoaderLogManager
- java.lang.Object
- 
- java.util.logging.LogManager
- 
- org.apache.juli.ClassLoaderLogManager
 
 
- 
 public class ClassLoaderLogManager extends java.util.logging.LogManagerPer classloader LogManager implementation. For light debugging, set the system propertyorg.apache.juli.ClassLoaderLogManager.debug=true. Short configuration information will be sent toSystem.err.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classClassLoaderLogManager.ClassLoaderLogInfoprotected static classClassLoaderLogManager.LogNodeprotected static classClassLoaderLogManager.RootLoggerThis class is needed to instantiate the root of each per classloader hierarchy.
 - 
Field SummaryFields Modifier and Type Field Description protected java.util.Map<java.lang.ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo>classLoaderLoggersMap containing the classloader information, keyed per classloader.static java.lang.StringDEBUG_PROPERTYprotected java.lang.ThreadLocal<java.lang.String>prefixThis prefix is used to allow using prefixes for the properties names of handlers and their subcomponents.protected booleanuseShutdownHookDetermines if the shutdown hook is used to perform any necessary clean-up such as flushing buffered handlers on JVM shutdown.
 - 
Constructor SummaryConstructors Constructor Description ClassLoaderLogManager()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddLogger(java.util.logging.Logger logger)Add the specified logger to the classloader local configuration.protected static voiddoSetParentLogger(java.util.logging.Logger logger, java.util.logging.Logger parent)Set parent child relationship between the two specified loggers.protected ClassLoaderLogManager.ClassLoaderLogInfogetClassLoaderInfo(java.lang.ClassLoader classLoader)Retrieve the configuration associated with the specified classloader.java.util.logging.LoggergetLogger(java.lang.String name)Get the logger associated with the specified name inside the classloader local configuration.java.util.Enumeration<java.lang.String>getLoggerNames()Get an enumeration of the logger names currently defined in the classloader local configuration.java.lang.StringgetProperty(java.lang.String name)Get the value of the specified property in the classloader local configuration.booleanisUseShutdownHook()voidreadConfiguration()voidreadConfiguration(java.io.InputStream is)protected voidreadConfiguration(java.io.InputStream is, java.lang.ClassLoader classLoader)Load specified configuration.protected voidreadConfiguration(java.lang.ClassLoader classLoader)Read configuration for the specified classloader.protected java.lang.Stringreplace(java.lang.String str)System property replacement in the given string.voidreset()voidsetUseShutdownHook(boolean useShutdownHook)voidshutdown()Shuts down the logging system.
 
- 
- 
- 
Field Detail- 
DEBUG_PROPERTYpublic static final java.lang.String DEBUG_PROPERTY 
 - 
classLoaderLoggersprotected final java.util.Map<java.lang.ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> classLoaderLoggers Map containing the classloader information, keyed per classloader. A weak hashmap is used to ensure no classloader reference is leaked from application redeployment.
 - 
prefixprotected final java.lang.ThreadLocal<java.lang.String> prefix This prefix is used to allow using prefixes for the properties names of handlers and their subcomponents.
 - 
useShutdownHookprotected volatile boolean useShutdownHook Determines if the shutdown hook is used to perform any necessary clean-up such as flushing buffered handlers on JVM shutdown. Defaults totruebut may be set to false if another component ensures thatshutdown()is called.
 
- 
 - 
Method Detail- 
isUseShutdownHookpublic boolean isUseShutdownHook() 
 - 
setUseShutdownHookpublic void setUseShutdownHook(boolean useShutdownHook) 
 - 
addLoggerpublic boolean addLogger(java.util.logging.Logger logger) Add the specified logger to the classloader local configuration.- Overrides:
- addLoggerin class- java.util.logging.LogManager
- Parameters:
- logger- The logger to be added
 
 - 
getLoggerpublic java.util.logging.Logger getLogger(java.lang.String name) Get the logger associated with the specified name inside the classloader local configuration. If this returns null, and the call originated for Logger.getLogger, a new logger with the specified name will be instantiated and added using addLogger.- Overrides:
- getLoggerin class- java.util.logging.LogManager
- Parameters:
- name- The name of the logger to retrieve
 
 - 
getLoggerNamespublic java.util.Enumeration<java.lang.String> getLoggerNames() Get an enumeration of the logger names currently defined in the classloader local configuration.- Overrides:
- getLoggerNamesin class- java.util.logging.LogManager
 
 - 
getPropertypublic java.lang.String getProperty(java.lang.String name) Get the value of the specified property in the classloader local configuration.- Overrides:
- getPropertyin class- java.util.logging.LogManager
- Parameters:
- name- The property name
 
 - 
readConfigurationpublic void readConfiguration() throws java.io.IOException, java.lang.SecurityException- Overrides:
- readConfigurationin class- java.util.logging.LogManager
- Throws:
- java.io.IOException
- java.lang.SecurityException
 
 - 
readConfigurationpublic void readConfiguration(java.io.InputStream is) throws java.io.IOException, java.lang.SecurityException- Overrides:
- readConfigurationin class- java.util.logging.LogManager
- Throws:
- java.io.IOException
- java.lang.SecurityException
 
 - 
resetpublic void reset() throws java.lang.SecurityException- Overrides:
- resetin class- java.util.logging.LogManager
- Throws:
- java.lang.SecurityException
 
 - 
shutdownpublic void shutdown() Shuts down the logging system.
 - 
getClassLoaderInfoprotected ClassLoaderLogManager.ClassLoaderLogInfo getClassLoaderInfo(java.lang.ClassLoader classLoader) Retrieve the configuration associated with the specified classloader. If it does not exist, it will be created. If no class loader is specified, the class loader used to load this class is used.- Parameters:
- classLoader- The class loader for which we will retrieve or build the configuration
- Returns:
- the log configuration
 
 - 
readConfigurationprotected void readConfiguration(java.lang.ClassLoader classLoader) throws java.io.IOExceptionRead configuration for the specified classloader.- Parameters:
- classLoader- The classloader
- Throws:
- java.io.IOException- Error reading configuration
 
 - 
readConfigurationprotected void readConfiguration(java.io.InputStream is, java.lang.ClassLoader classLoader) throws java.io.IOExceptionLoad specified configuration.- Parameters:
- is- InputStream to the properties file
- classLoader- for which the configuration will be loaded
- Throws:
- java.io.IOException- If something wrong happens during loading
 
 - 
doSetParentLoggerprotected static void doSetParentLogger(java.util.logging.Logger logger, java.util.logging.Logger parent)Set parent child relationship between the two specified loggers.- Parameters:
- logger- The logger
- parent- The parent logger
 
 - 
replaceprotected java.lang.String replace(java.lang.String str) System property replacement in the given string.- Parameters:
- str- The original string
- Returns:
- the modified string
 
 
- 
 
-