Package org.apache.logging.slf4j
Class Log4jLoggerFactory
java.lang.Object
org.apache.logging.log4j.spi.AbstractLoggerAdapter<org.slf4j.Logger>
org.apache.logging.slf4j.Log4jLoggerFactory
- All Implemented Interfaces:
Closeable,AutoCloseable,LoggerAdapter<org.slf4j.Logger>,LoggerContextShutdownAware,org.slf4j.ILoggerFactory
public class Log4jLoggerFactory
extends AbstractLoggerAdapter<org.slf4j.Logger>
implements org.slf4j.ILoggerFactory
Log4j implementation of SLF4J ILoggerFactory interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StatusLoggerprivate static final Stringprivate static final StringFields inherited from class org.apache.logging.log4j.spi.AbstractLoggerAdapter
registry -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LoggerContextGets theLoggerContextthat should be used to look up or create loggers.protected org.slf4j.LoggernewLogger(String name, LoggerContext context) Creates a new named logger for a givenLoggerContext.private LoggerContextvalidateContext(LoggerContext context) Methods inherited from class org.apache.logging.log4j.spi.AbstractLoggerAdapter
close, contextShutdown, getContext, getLogger, getLoggerContexts, getLoggersInContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.slf4j.ILoggerFactory
getLogger
-
Field Details
-
LOGGER
-
SLF4J_PACKAGE
- See Also:
-
TO_SLF4J_CONTEXT
- See Also:
-
CALLER_PREDICATE
-
-
Constructor Details
-
Log4jLoggerFactory
public Log4jLoggerFactory()
-
-
Method Details
-
newLogger
Description copied from class:AbstractLoggerAdapterCreates a new named logger for a givenLoggerContext.- Specified by:
newLoggerin classAbstractLoggerAdapter<org.slf4j.Logger>- Parameters:
name- the name of the logger to createcontext- the LoggerContext this logger will be associated with- Returns:
- the new named logger
-
getContext
Description copied from class:AbstractLoggerAdapterGets theLoggerContextthat should be used to look up or create loggers. This is similar in spirit to theContextSelectorclass inlog4j-core. However, implementations can rely on their own framework's separation of contexts instead (or simply use a singleton).- Specified by:
getContextin classAbstractLoggerAdapter<org.slf4j.Logger>- Returns:
- the LoggerContext to be used for lookup and creation purposes
- See Also:
-
validateContext
-