Package org.apache.logging.log4j.util
Class ProviderUtil
java.lang.Object
org.apache.logging.log4j.util.ProviderUtil
Consider this class private. Utility class for Log4j
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String[]
private static ProviderUtil
private static final Logger
protected static final String
Resource name for a Log4j 2 provider properties file.protected static final Collection
<Provider> Loaded providers.protected static final Lock
Guards the ProviderUtil singleton instance from lazy initialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addProvider
(Provider provider) static ClassLoader
static boolean
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.private static boolean
validVersion
(String version)
-
Field Details
-
PROVIDER_RESOURCE
Resource name for a Log4j 2 provider properties file.- See Also:
-
PROVIDERS
Loaded providers. -
STARTUP_LOCK
Guards the ProviderUtil singleton instance from lazy initialization. This is primarily used for OSGi support.- Since:
- 2.1
-
API_VERSION
- See Also:
-
COMPATIBLE_API_VERSIONS
-
LOGGER
-
instance
-
-
Constructor Details
-
ProviderUtil
private ProviderUtil()
-
-
Method Details
-
addProvider
-
loadProvider
Loads an individual Provider implementation. This method is really only useful for the OSGi bundle activator and this class itself.- Parameters:
url
- the URL to the provider properties filecl
- the ClassLoader to load the provider classes with
-
loadProviders
- Parameters:
classLoader
- null can be used to mark the bootstrap class loader.
-
loadProviders
Deprecated.UseloadProvider(java.net.URL, ClassLoader)
instead. Will be removed in 3.0. -
getProviders
-
hasProviders
public static boolean hasProviders() -
lazyInit
protected static void lazyInit()Lazily initializes the ProviderUtil singleton.- Since:
- 2.1
-
findClassLoader
-
validVersion
-
loadProvider(java.net.URL, ClassLoader)
instead.