public class ContextClassLoaderRepositorySelector extends Object implements org.apache.log4j.spi.RepositorySelector
LoggerRepository heirarchies for different context class loaders. The
add() method can be used to create a seperate logger repository for
the current thread context class loader. When the class loader is about to be
destroyed use the remove() method to clean up the logger repository
for the class loader. See the Log4jServletContextListener for use in web
applications.| Constructor and Description |
|---|
ContextClassLoaderRepositorySelector() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.log4j.Hierarchy |
add()
Add a new hierarchy for the current thread context class loader if one does
not exist or return the previous hierarchy.
|
static org.apache.log4j.Hierarchy |
add(ClassLoader classLoader)
Add a new hierarchy for the specified class loader if one does not exist or
return the previous hierarchy.
|
org.apache.log4j.spi.LoggerRepository |
getLoggerRepository()
Get the logger repository for the current thread context class loader or
the default one if one does not exist.
|
static void |
remove()
Remove and shutdown the hierarchy for the current thread context class
loader class loader.
|
static void |
remove(ClassLoader classLoader)
Remove and shutdown the hierarchy for the specified class loader.
|
public ContextClassLoaderRepositorySelector()
public static org.apache.log4j.Hierarchy add()
public static org.apache.log4j.Hierarchy add(ClassLoader classLoader)
classLoader - The classloader to create the hierarchy for.public static void remove()
public static void remove(ClassLoader classLoader)
classLoader - The classloader to create the hierarchy for.public final org.apache.log4j.spi.LoggerRepository getLoggerRepository()
getLoggerRepository in interface org.apache.log4j.spi.RepositorySelectorCopyright © 2015 Revolution Systems Inc.. All rights reserved.