public class ClassLoaderLogManager
extends java.util.logging.LogManager
org.apache.juli.ClassLoaderLogManager.debug=true
.
Short configuration information will be sent to System.err
.Modifier and Type | Class and Description |
---|---|
protected static class |
ClassLoaderLogManager.ClassLoaderLogInfo |
protected static class |
ClassLoaderLogManager.LogNode |
protected static class |
ClassLoaderLogManager.RootLogger
This class is needed to instantiate the root of each per classloader
hierarchy.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> |
classLoaderLoggers
Map containing the classloader information, keyed per classloader.
|
static java.lang.String |
DEBUG_PROPERTY |
protected java.lang.ThreadLocal<java.lang.String> |
prefix
This prefix is used to allow using prefixes for the properties names
of handlers and their subcomponents.
|
protected boolean |
useShutdownHook
Determines if the shutdown hook is used to perform any necessary
clean-up such as flushing buffered handlers on JVM shutdown.
|
Constructor and Description |
---|
ClassLoaderLogManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
addLogger(java.util.logging.Logger logger)
Add the specified logger to the classloader local configuration.
|
protected static void |
doSetParentLogger(java.util.logging.Logger logger,
java.util.logging.Logger parent)
Set parent child relationship between the two specified loggers.
|
protected ClassLoaderLogManager.ClassLoaderLogInfo |
getClassLoaderInfo(java.lang.ClassLoader classLoader)
Retrieve the configuration associated with the specified classloader.
|
java.util.logging.Logger |
getLogger(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.String |
getProperty(java.lang.String name)
Get the value of the specified property in the classloader local
configuration.
|
boolean |
isUseShutdownHook() |
void |
readConfiguration() |
protected void |
readConfiguration(java.lang.ClassLoader classLoader)
Read configuration for the specified classloader.
|
void |
readConfiguration(java.io.InputStream is) |
protected void |
readConfiguration(java.io.InputStream is,
java.lang.ClassLoader classLoader)
Load specified configuration.
|
protected java.lang.String |
replace(java.lang.String str)
System property replacement in the given string.
|
void |
reset() |
void |
setUseShutdownHook(boolean useShutdownHook) |
void |
shutdown()
Shuts down the logging system.
|
public static final java.lang.String DEBUG_PROPERTY
protected final java.util.Map<java.lang.ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> classLoaderLoggers
protected final java.lang.ThreadLocal<java.lang.String> prefix
protected volatile boolean useShutdownHook
true
but may be set to false if another component ensures
that shutdown()
is called.public boolean isUseShutdownHook()
public void setUseShutdownHook(boolean useShutdownHook)
public boolean addLogger(java.util.logging.Logger logger)
addLogger
in class java.util.logging.LogManager
logger
- The logger to be addedpublic java.util.logging.Logger getLogger(java.lang.String name)
getLogger
in class java.util.logging.LogManager
name
- The name of the logger to retrievepublic java.util.Enumeration<java.lang.String> getLoggerNames()
getLoggerNames
in class java.util.logging.LogManager
public java.lang.String getProperty(java.lang.String name)
getProperty
in class java.util.logging.LogManager
name
- The property namepublic void readConfiguration() throws java.io.IOException, java.lang.SecurityException
readConfiguration
in class java.util.logging.LogManager
java.io.IOException
java.lang.SecurityException
public void readConfiguration(java.io.InputStream is) throws java.io.IOException, java.lang.SecurityException
readConfiguration
in class java.util.logging.LogManager
java.io.IOException
java.lang.SecurityException
public void reset() throws java.lang.SecurityException
reset
in class java.util.logging.LogManager
java.lang.SecurityException
public void shutdown()
protected ClassLoaderLogManager.ClassLoaderLogInfo getClassLoaderInfo(java.lang.ClassLoader classLoader)
classLoader
- The classloader for which we will retrieve or build the
configurationprotected void readConfiguration(java.lang.ClassLoader classLoader) throws java.io.IOException
classLoader
- java.io.IOException
- Errorprotected void readConfiguration(java.io.InputStream is, java.lang.ClassLoader classLoader) throws java.io.IOException
is
- InputStream to the properties fileclassLoader
- for which the configuration will be loadedjava.io.IOException
- If something wrong happens during loadingprotected static void doSetParentLogger(java.util.logging.Logger logger, java.util.logging.Logger parent)
logger
- parent
- protected java.lang.String replace(java.lang.String str)
str
- The original stringCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.