public class ClassLoaderLogManager extends 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 Map<ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> |
classLoaderLoggers
Map containing the classloader information, keyed per classloader.
|
static String |
DEBUG_PROPERTY |
protected ThreadLocal<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.
|
LOGGING_MXBEAN_NAME
Constructor and Description |
---|
ClassLoaderLogManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
addLogger(Logger logger)
Add the specified logger to the classloader local configuration.
|
protected static void |
doSetParentLogger(Logger logger,
Logger parent)
Set parent child relationship between the two specified loggers.
|
protected ClassLoaderLogManager.ClassLoaderLogInfo |
getClassLoaderInfo(ClassLoader classLoader)
Retrieve the configuration associated with the specified classloader.
|
Logger |
getLogger(String name)
Get the logger associated with the specified name inside
the classloader local configuration.
|
Enumeration<String> |
getLoggerNames()
Get an enumeration of the logger names currently defined in the
classloader local configuration.
|
String |
getProperty(String name)
Get the value of the specified property in the classloader local
configuration.
|
boolean |
isUseShutdownHook() |
void |
readConfiguration() |
protected void |
readConfiguration(ClassLoader classLoader)
Read configuration for the specified classloader.
|
void |
readConfiguration(InputStream is) |
protected void |
readConfiguration(InputStream is,
ClassLoader classLoader)
Load specified configuration.
|
protected String |
replace(String str)
System property replacement in the given string.
|
void |
reset() |
void |
setUseShutdownHook(boolean useShutdownHook) |
void |
shutdown()
Shuts down the logging system.
|
addPropertyChangeListener, checkAccess, getLoggingMXBean, getLogManager, removePropertyChangeListener
public static final String DEBUG_PROPERTY
protected final Map<ClassLoader,ClassLoaderLogManager.ClassLoaderLogInfo> classLoaderLoggers
protected final ThreadLocal<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(Logger logger)
addLogger
in class LogManager
logger
- The logger to be addedpublic Logger getLogger(String name)
getLogger
in class LogManager
name
- The name of the logger to retrievepublic Enumeration<String> getLoggerNames()
getLoggerNames
in class LogManager
public String getProperty(String name)
getProperty
in class LogManager
name
- The property namepublic void readConfiguration() throws IOException, SecurityException
readConfiguration
in class LogManager
IOException
SecurityException
public void readConfiguration(InputStream is) throws IOException, SecurityException
readConfiguration
in class LogManager
IOException
SecurityException
public void reset() throws SecurityException
reset
in class LogManager
SecurityException
public void shutdown()
protected ClassLoaderLogManager.ClassLoaderLogInfo getClassLoaderInfo(ClassLoader classLoader)
classLoader
- The classloader for which we will retrieve or build the
configurationprotected void readConfiguration(ClassLoader classLoader) throws IOException
classLoader
- IOException
- Errorprotected void readConfiguration(InputStream is, ClassLoader classLoader) throws IOException
is
- InputStream to the properties fileclassLoader
- for which the configuration will be loadedIOException
- If something wrong happens during loadingprotected static void doSetParentLogger(Logger logger, Logger parent)
logger
- parent
- Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.