Package org.apache.juli
Class ClassLoaderLogManager
java.lang.Object
java.util.logging.LogManager
org.apache.juli.ClassLoaderLogManager
Per classloader LogManager implementation. For light debugging, set the system property
 
org.apache.juli.ClassLoaderLogManager.debug=true. Short configuration information will be sent to
 System.err.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static final classprotected static final classprotected static classThis class is needed to instantiate the root of each per classloader hierarchy.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Map<ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> Map containing the classloader information, keyed per classloader.static final Stringprotected final ThreadLocal<String>This prefix is used to allow using prefixes for the properties names of handlers and their subcomponents.protected booleanDetermines if the shutdown hook is used to perform any necessary clean-up such as flushing buffered handlers on JVM shutdown.Fields inherited from class java.util.logging.LogManagerLOGGING_MXBEAN_NAME
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanAdd the specified logger to the classloader local configuration.protected static voiddoSetParentLogger(Logger logger, Logger parent) Set parent child relationship between the two specified loggers.protected ClassLoaderLogManager.ClassLoaderLogInfogetClassLoaderInfo(ClassLoader classLoader) Retrieve the configuration associated with the specified classloader.Get the logger associated with the specified name inside the classloader local configuration.Get an enumeration of the logger names currently defined in the classloader local configuration.getProperty(String name) Get the value of the specified property in the classloader local configuration.booleanvoidvoidprotected voidreadConfiguration(InputStream is, ClassLoader classLoader) Load specified configuration.protected voidreadConfiguration(ClassLoader classLoader) Read configuration for the specified classloader.protected StringSystem property replacement in the given string.voidreset()voidsetUseShutdownHook(boolean useShutdownHook) voidshutdown()Shuts down the logging system.Methods inherited from class java.util.logging.LogManageraddConfigurationListener, checkAccess, getLoggingMXBean, getLogManager, removeConfigurationListener, updateConfiguration, updateConfiguration
- 
Field Details- 
DEBUG_PROPERTY
- 
classLoaderLoggersMap containing the classloader information, keyed per classloader. A weak hashmap is used to ensure no classloader reference is leaked from application redeployment.
- 
prefixThis prefix is used to allow using prefixes for the properties names of handlers and their subcomponents.
- 
useShutdownHookprotected volatile boolean useShutdownHookDetermines 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.
 
- 
- 
Constructor Details- 
ClassLoaderLogManagerpublic ClassLoaderLogManager()
 
- 
- 
Method Details- 
isUseShutdownHookpublic boolean isUseShutdownHook()
- 
setUseShutdownHookpublic void setUseShutdownHook(boolean useShutdownHook) 
- 
addLoggerAdd the specified logger to the classloader local configuration.- Overrides:
- addLoggerin class- LogManager
- Parameters:
- logger- The logger to be added
 
- 
getLoggerGet 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- LogManager
- Parameters:
- name- The name of the logger to retrieve
 
- 
getLoggerNamesGet an enumeration of the logger names currently defined in the classloader local configuration.- Overrides:
- getLoggerNamesin class- LogManager
 
- 
getPropertyGet the value of the specified property in the classloader local configuration.- Overrides:
- getPropertyin class- LogManager
- Parameters:
- name- The property name
 
- 
readConfiguration- Overrides:
- readConfigurationin class- LogManager
- Throws:
- IOException
- SecurityException
 
- 
readConfiguration- Overrides:
- readConfigurationin class- LogManager
- Throws:
- IOException
- SecurityException
 
- 
reset- Overrides:
- resetin class- LogManager
- Throws:
- SecurityException
 
- 
shutdownpublic void shutdown()Shuts down the logging system.
- 
getClassLoaderInfoRetrieve 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
 
- 
readConfigurationRead configuration for the specified classloader.- Parameters:
- classLoader- The classloader
- Throws:
- IOException- Error reading configuration
 
- 
readConfigurationLoad specified configuration.- Parameters:
- is- InputStream to the properties file
- classLoader- for which the configuration will be loaded
- Throws:
- IOException- If something wrong happens during loading
 
- 
doSetParentLoggerSet parent child relationship between the two specified loggers.- Parameters:
- logger- The logger
- parent- The parent logger
 
- 
replaceSystem property replacement in the given string.- Parameters:
- str- The original string
- Returns:
- the modified string
 
 
-