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:
java.io.Closeable
,java.lang.AutoCloseable
,LoggerAdapter<L>
,LoggerContextShutdownAware
public abstract class AbstractLoggerAdapter<L> extends java.lang.Object implements LoggerAdapter<L>, LoggerContextShutdownAware
Provides an abstract base class to use for implementing LoggerAdapter.- Since:
- 2.1
-
-
Constructor Summary
Constructors Constructor Description AbstractLoggerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
contextShutdown(LoggerContext loggerContext)
L
getLogger(java.lang.String name)
Gets a named logger.java.util.Set<LoggerContext>
getLoggerContexts()
For unit testing.java.util.concurrent.ConcurrentMap<java.lang.String,L>
getLoggersInContext(LoggerContext context)
Gets or creates the ConcurrentMap of named loggers for a given LoggerContext.
-
-
-
Method Detail
-
getLogger
public L getLogger(java.lang.String name)
Description copied from interface:LoggerAdapter
Gets a named logger. Implementations should defer to the abstract methods inAbstractLoggerAdapter
.- Specified by:
getLogger
in interfaceLoggerAdapter<L>
- Parameters:
name
- the name of the logger to get- Returns:
- the named logger
-
contextShutdown
public void contextShutdown(LoggerContext loggerContext)
- Specified by:
contextShutdown
in interfaceLoggerContextShutdownAware
-
getLoggersInContext
public java.util.concurrent.ConcurrentMap<java.lang.String,L> getLoggersInContext(LoggerContext context)
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
public java.util.Set<LoggerContext> getLoggerContexts()
For unit testing. Consider to be private.
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-