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
Providers. 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 Stringprivate static final String[]private static ProviderUtilprivate static final Loggerprotected static final StringResource name for a Log4j 2 provider properties file.protected static final Collection<Provider> Loaded providers.protected static final LockGuards the ProviderUtil singleton instance from lazy initialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddProvider(Provider provider) static ClassLoaderstatic booleanprotected static voidlazyInit()Lazily initializes the ProviderUtil singleton.protected static voidloadProvider(URL url, ClassLoader cl) Loads an individual Provider implementation.protected static voidloadProviders(ClassLoader classLoader) protected static voidloadProviders(Enumeration<URL> urls, ClassLoader cl) Deprecated.private static booleanvalidVersion(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.