public final class ProviderUtil extends Object
Provider
s. When integrating with an application
container framework, any Log4j Providers not accessible through standard classpath scanning should
loadProvider(java.net.URL, ClassLoader)
a classpath accordingly.Modifier and Type | Field | Description |
---|---|---|
protected static String |
PROVIDER_RESOURCE |
Resource name for a Log4j 2 provider properties file.
|
protected static Collection<Provider> |
PROVIDERS |
Loaded providers.
|
protected static Lock |
STARTUP_LOCK |
Guards the ProviderUtil singleton instance from lazy initialization.
|
Modifier and Type | Method | Description |
---|---|---|
protected static void |
addProvider(Provider provider) |
|
static ClassLoader |
findClassLoader() |
|
static Iterable<Provider> |
getProviders() |
|
static boolean |
hasProviders() |
|
protected static void |
lazyInit() |
Lazily initializes the ProviderUtil singleton.
|
protected static void |
loadProvider(URL url,
ClassLoader cl) |
Loads an individual Provider implementation.
|
protected static void |
loadProviders(ClassLoader classLoader) |
|
protected static void |
loadProviders(Enumeration<URL> urls,
ClassLoader cl) |
Deprecated.
Use
loadProvider(java.net.URL, ClassLoader) instead. |
protected static final String PROVIDER_RESOURCE
protected static final Collection<Provider> PROVIDERS
protected static final Lock STARTUP_LOCK
protected static void addProvider(Provider provider)
protected static void loadProvider(URL url, ClassLoader cl)
url
- the URL to the provider properties filecl
- the ClassLoader to load the provider classes withprotected static void loadProviders(ClassLoader classLoader)
classLoader
- null can be used to mark the bootstrap class loader.@Deprecated protected static void loadProviders(Enumeration<URL> urls, ClassLoader cl)
loadProvider(java.net.URL, ClassLoader)
instead. Will be removed in 3.0.public static boolean hasProviders()
protected static void lazyInit()
public static ClassLoader findClassLoader()
Copyright © 1999-2018. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.