Package org.apache.log4j
Class Hierarchy.PrivateLoggerAdapter
- java.lang.Object
-
- org.apache.logging.log4j.spi.AbstractLoggerAdapter<Logger>
-
- org.apache.log4j.Hierarchy.PrivateLoggerAdapter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LoggerAdapter<Logger>
,LoggerContextShutdownAware
- Enclosing class:
- Hierarchy
private static class Hierarchy.PrivateLoggerAdapter extends AbstractLoggerAdapter<Logger>
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.spi.AbstractLoggerAdapter
registry
-
-
Constructor Summary
Constructors Modifier Constructor Description private
PrivateLoggerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoggerContext
getContext()
Gets theLoggerContext
that should be used to look up or create loggers.protected Logger
newLogger(java.lang.String name, LoggerContext context)
Creates a new named logger for a givenLoggerContext
.-
Methods inherited from class org.apache.logging.log4j.spi.AbstractLoggerAdapter
close, contextShutdown, getContext, getLogger, getLoggerContexts, getLoggersInContext
-
-
-
-
Method Detail
-
getContext
protected LoggerContext getContext()
Description copied from class:AbstractLoggerAdapter
Gets theLoggerContext
that should be used to look up or create loggers. This is similar in spirit to theContextSelector
class inlog4j-core
. However, implementations can rely on their own framework's separation of contexts instead (or simply use a singleton).- Specified by:
getContext
in classAbstractLoggerAdapter<Logger>
- Returns:
- the LoggerContext to be used for lookup and creation purposes
- See Also:
LogManager.getContext(ClassLoader, boolean)
,LogManager.getContext(String, boolean)
-
newLogger
protected Logger newLogger(java.lang.String name, LoggerContext context)
Description copied from class:AbstractLoggerAdapter
Creates a new named logger for a givenLoggerContext
.- Specified by:
newLogger
in classAbstractLoggerAdapter<Logger>
- Parameters:
name
- the name of the logger to createcontext
- the LoggerContext this logger will be associated with- Returns:
- the new named logger
-
-