Package org.apache.logging.log4j.spi
Class AbstractLoggerAdapter<L>
java.lang.Object
org.apache.logging.log4j.spi.AbstractLoggerAdapter<L>
- Type Parameters:
L- the Logger class to adapt
- All Implemented Interfaces:
Closeable,AutoCloseable,LoggerAdapter<L>,LoggerContextShutdownAware
public abstract class AbstractLoggerAdapter<L>
extends Object
implements LoggerAdapter<L>, LoggerContextShutdownAware
Provides an abstract base class to use for implementing LoggerAdapter.
- Since:
- 2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcontextShutdown(LoggerContext loggerContext) Gets a named logger.For unit testing.getLoggersInContext(LoggerContext context) Gets or creates the ConcurrentMap of named loggers for a given LoggerContext.
-
Constructor Details
-
AbstractLoggerAdapter
public AbstractLoggerAdapter()
-
-
Method Details
-
getLogger
Description copied from interface:LoggerAdapterGets a named logger. Implementations should defer to the abstract methods inAbstractLoggerAdapter.- Specified by:
getLoggerin interfaceLoggerAdapter<L>- Parameters:
name- the name of the logger to get- Returns:
- the named logger
-
contextShutdown
- Specified by:
contextShutdownin interfaceLoggerContextShutdownAware
-
getLoggersInContext
Gets or creates the ConcurrentMap of named loggers for a given LoggerContext.- Parameters:
context- the LoggerContext to get loggers for- Returns:
- the map of loggers for the given LoggerContext
-
getLoggerContexts
For unit testing. Consider to be private. -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-