Package org.apache.logging.log4j.util
Class ProviderUtil
- java.lang.Object
- 
- org.apache.logging.log4j.util.ProviderUtil
 
- 
 public final class ProviderUtil extends Object Consider this class private. Utility class for Log4jProviders. When integrating with an application container framework, any Log4j Providers not accessible through standard classpath scanning shouldloadProvider(java.net.URL, ClassLoader)a classpath accordingly.
- 
- 
Field SummaryFields Modifier and Type Field Description protected static StringPROVIDER_RESOURCEResource name for a Log4j 2 provider properties file.protected static Collection<Provider>PROVIDERSLoaded providers.protected static LockSTARTUP_LOCKGuards the ProviderUtil singleton instance from lazy initialization.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static voidaddProvider(Provider provider)static ClassLoaderfindClassLoader()static Iterable<Provider>getProviders()static booleanhasProviders()protected 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.UseloadProvider(java.net.URL, ClassLoader)instead.
 
- 
- 
- 
Field Detail- 
PROVIDER_RESOURCEprotected static final String PROVIDER_RESOURCE Resource name for a Log4j 2 provider properties file.- See Also:
- Constant Field Values
 
 - 
PROVIDERSprotected static final Collection<Provider> PROVIDERS Loaded providers.
 - 
STARTUP_LOCKprotected static final Lock STARTUP_LOCK Guards the ProviderUtil singleton instance from lazy initialization. This is primarily used for OSGi support.- Since:
- 2.1
 
 
- 
 - 
Method Detail- 
addProviderprotected static void addProvider(Provider provider) 
 - 
loadProviderprotected static void loadProvider(URL url, ClassLoader cl) 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 file
- cl- the ClassLoader to load the provider classes with
 
 - 
loadProvidersprotected static void loadProviders(ClassLoader classLoader) - Parameters:
- classLoader- null can be used to mark the bootstrap class loader.
 
 - 
loadProviders@Deprecated protected static void loadProviders(Enumeration<URL> urls, ClassLoader cl) Deprecated.UseloadProvider(java.net.URL, ClassLoader)instead. Will be removed in 3.0.
 - 
hasProviderspublic static boolean hasProviders() 
 - 
lazyInitprotected static void lazyInit() Lazily initializes the ProviderUtil singleton.- Since:
- 2.1
 
 - 
findClassLoaderpublic static ClassLoader findClassLoader() 
 
- 
 
-