LoggerFactory is a utility class producing Loggers for
various logging APIs, e.g. logback, reload4j, log4j and JDK 1.4 logging.
Other implementations such as NOPLogger and
SimpleLogger are also supported.
LoggerFactory is essentially a wrapper around an
ILoggerFactory instance provided by a SLF4JServiceProvider.
Please note that all methods in LoggerFactory are static.
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | API_COMPATIBILITY_LIST
It is LoggerFactory's responsibility to track version changes and manage the compatibility list. |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static boolean | |
| pack-priv static final String | |
| pack-priv static final int | |
| pack-priv static final String | |
| pack-priv static volatile int | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final int | |
| pack-priv static final NOP_FallbackServiceProvider | |
| pack-priv static final int | |
| pack-priv static volatile SLF4JServiceProvider | |
| public static final String | PROVIDER_PROPERTY_KEY
System property for explicitly setting the provider class. |
| pack-priv static final String | |
| private static final String | |
| pack-priv static final SubstituteServiceProvider | |
| pack-priv static final String | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final String | |
| pack-priv static final String | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static final void | |
| private static void | earlyBindMDCAdapter()
The value of PROVIDER.getMDCAdapter() can be null while PROVIDER has not yet initialized. |
| private static void | |
| private static void | |
| private static void | |
| pack-priv static void | |
| pack-priv static Set | |
| pack-priv static List | |
| private static void | |
| public static ILoggerFactory | Returns: the ILoggerFactory instance in useReturn the |
| public static Logger | Returns: loggerThe name of the logger. name)Return a logger named according to the name parameter using the
statically bound |
| public static Logger | Returns: loggerthe returned logger will be named after clazz clazz)Return a logger named corresponding to the class passed as parameter,
using the statically bound |
| pack-priv static SLF4JServiceProvider | |
| private static ServiceLoader | |
| private static boolean | |
| pack-priv static SLF4JServiceProvider | |
| private static boolean | |
| private static final void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | reportMultipleBindingAmbiguity(List<SLF4JServiceProvider> providerList)
Prints a warning message on the console if multiple bindings were found on the class path. |
| pack-priv static void | |
| private static void | |
| private static final void |
| API_COMPATIBILITY_LIST | back to summary |
|---|---|
| private static final String[] API_COMPATIBILITY_LIST It is LoggerFactory's responsibility to track version changes and manage the compatibility list.
| |
| CODES_PREFIX | back to summary |
|---|---|
| pack-priv static final String CODES_PREFIX | |
| CONNECTED_WITH_MSG | back to summary |
|---|---|
| pack-priv static final String CONNECTED_WITH_MSG | |
| DETECT_LOGGER_NAME_MISMATCH | back to summary |
|---|---|
| pack-priv static boolean DETECT_LOGGER_NAME_MISMATCH | |
| DETECT_LOGGER_NAME_MISMATCH_PROPERTY | back to summary |
|---|---|
| pack-priv static final String DETECT_LOGGER_NAME_MISMATCH_PROPERTY | |
| FAILED_INITIALIZATION | back to summary |
|---|---|
| pack-priv static final int FAILED_INITIALIZATION | |
| IGNORED_BINDINGS_URL | back to summary |
|---|---|
| pack-priv static final String IGNORED_BINDINGS_URL | |
| INITIALIZATION_STATE | back to summary |
|---|---|
| pack-priv static volatile int INITIALIZATION_STATE | |
| JAVA_VENDOR_PROPERTY | back to summary |
|---|---|
| pack-priv static final String JAVA_VENDOR_PROPERTY | |
| LOGGER_NAME_MISMATCH_URL | back to summary |
|---|---|
| pack-priv static final String LOGGER_NAME_MISMATCH_URL | |
| MULTIPLE_BINDINGS_URL | back to summary |
|---|---|
| pack-priv static final String MULTIPLE_BINDINGS_URL | |
| NO_PROVIDERS_URL | back to summary |
|---|---|
| pack-priv static final String NO_PROVIDERS_URL | |
| NOP_FALLBACK_INITIALIZATION | back to summary |
|---|---|
| pack-priv static final int NOP_FALLBACK_INITIALIZATION | |
| NOP_FALLBACK_SERVICE_PROVIDER | back to summary |
|---|---|
| pack-priv static final NOP_FallbackServiceProvider NOP_FALLBACK_SERVICE_PROVIDER | |
| ONGOING_INITIALIZATION | back to summary |
|---|---|
| pack-priv static final int ONGOING_INITIALIZATION | |
| PROVIDER | back to summary |
|---|---|
| pack-priv static volatile SLF4JServiceProvider PROVIDER | |
| PROVIDER_PROPERTY_KEY | back to summary |
|---|---|
| public static final String PROVIDER_PROPERTY_KEY System property for explicitly setting the provider class. If set and the provider could be instantiated, then the service loading mechanism will be bypassed.
| |
| REPLAY_URL | back to summary |
|---|---|
| pack-priv static final String REPLAY_URL | |
| STATIC_LOGGER_BINDER_PATH | back to summary |
|---|---|
| private static final String STATIC_LOGGER_BINDER_PATH | |
| SUBST_PROVIDER | back to summary |
|---|---|
| pack-priv static final SubstituteServiceProvider SUBST_PROVIDER | |
| SUBSTITUTE_LOGGER_URL | back to summary |
|---|---|
| pack-priv static final String SUBSTITUTE_LOGGER_URL | |
| SUCCESSFUL_INITIALIZATION | back to summary |
|---|---|
| pack-priv static final int SUCCESSFUL_INITIALIZATION | |
| UNINITIALIZED | back to summary |
|---|---|
| pack-priv static final int UNINITIALIZED | |
| UNSUCCESSFUL_INIT_MSG | back to summary |
|---|---|
| pack-priv static final String UNSUCCESSFUL_INIT_MSG | |
| UNSUCCESSFUL_INIT_URL | back to summary |
|---|---|
| pack-priv static final String UNSUCCESSFUL_INIT_URL | |
| VERSION_MISMATCH | back to summary |
|---|---|
| pack-priv static final String VERSION_MISMATCH | |
| LoggerFactory | back to summary |
|---|---|
| private LoggerFactory() | |
| bind | back to summary |
|---|---|
| private static final void bind() | |
| earlyBindMDCAdapter | back to summary |
|---|---|
| private static void earlyBindMDCAdapter() The value of PROVIDER.getMDCAdapter() can be null while PROVIDER has not yet initialized. However, SLF4JServiceProvider implementations are expected to initialize their internal MDCAdapter field in their constructor or on field declaration. | |
| emitReplayOrSubstituionWarning | back to summary |
|---|---|
| private static void emitReplayOrSubstituionWarning(SubstituteLoggingEvent event, int queueSize) | |
| emitReplayWarning | back to summary |
|---|---|
| private static void emitReplayWarning(int eventCount) | |
| emitSubstitutionWarning | back to summary |
|---|---|
| private static void emitSubstitutionWarning() | |
| failedBinding | back to summary |
|---|---|
| pack-priv static void failedBinding(Throwable t) | |
| findPossibleStaticLoggerBinderPathSet | back to summary |
|---|---|
| pack-priv static Set | |
| findServiceProviders | back to summary |
|---|---|
| pack-priv static List | |
| fixSubstituteLoggers | back to summary |
|---|---|
| private static void fixSubstituteLoggers() | |
| getILoggerFactory | back to summary |
|---|---|
| public static ILoggerFactory getILoggerFactory() Return the
ILoggerFactory instance is bound with this class at compile time.
| |
| getLogger | back to summary |
|---|---|
| public static Logger getLogger(String name) Return a logger named according to the name parameter using the
statically bound | |
| getLogger | back to summary |
|---|---|
| public static Logger getLogger(Class<?> clazz) Return a logger named corresponding to the class passed as parameter,
using the statically bound
In case the
| |
| getProvider | back to summary |
|---|---|
| pack-priv static SLF4JServiceProvider getProvider() Return the
| |
| getServiceLoader | back to summary |
|---|---|
| private static ServiceLoader | |
| isAmbiguousProviderList | back to summary |
|---|---|
| private static boolean isAmbiguousProviderList(List<SLF4JServiceProvider> providerList) | |
| loadExplicitlySpecified | back to summary |
|---|---|
| pack-priv static SLF4JServiceProvider loadExplicitlySpecified(ClassLoader classLoader) | |
| nonMatchingClasses | back to summary |
|---|---|
| private static boolean nonMatchingClasses(Class<?> clazz, Class<?> autoComputedCallingClass) | |
| performInitialization | back to summary |
|---|---|
| private static final void performInitialization() | |
| postBindCleanUp | back to summary |
|---|---|
| private static void postBindCleanUp() | |
| replayEvents | back to summary |
|---|---|
| private static void replayEvents() | |
| replaySingleEvent | back to summary |
|---|---|
| private static void replaySingleEvent(SubstituteLoggingEvent event) | |
| reportActualBinding | back to summary |
|---|---|
| private static void reportActualBinding(List<SLF4JServiceProvider> providerList) | |
| reportIgnoredStaticLoggerBinders | back to summary |
|---|---|
| private static void reportIgnoredStaticLoggerBinders(Set<URL> staticLoggerBinderPathSet) | |
| reportMultipleBindingAmbiguity | back to summary |
|---|---|
| private static void reportMultipleBindingAmbiguity(List<SLF4JServiceProvider> providerList) Prints a warning message on the console if multiple bindings were found on the class path. No reporting is done otherwise. | |
| reset | back to summary |
|---|---|
| pack-priv static void reset() Force LoggerFactory to consider itself uninitialized.
This method is intended to be called by classes (in the same package) for testing purposes. This method is internal. It can be modified, renamed or removed at any time without notice.
You are strongly discouraged from calling this method in production code. | |
| safelyInstantiate | back to summary |
|---|---|
| private static void safelyInstantiate(List<SLF4JServiceProvider> providerList, Iterator<SLF4JServiceProvider> iterator) | |
| versionSanityCheck | back to summary |
|---|---|
| private static final void versionSanityCheck() | |