Package org.apache.logging.log4j.jcl
Class LogAdapter
- java.lang.Object
-
- org.apache.logging.log4j.spi.AbstractLoggerAdapter<org.apache.commons.logging.Log>
-
- org.apache.logging.log4j.jcl.LogAdapter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,LoggerAdapter<org.apache.commons.logging.Log>,LoggerContextShutdownAware
public class LogAdapter extends AbstractLoggerAdapter<org.apache.commons.logging.Log>
Commons Logging adapter registry.- Since:
- 2.1
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.spi.AbstractLoggerAdapter
registry
-
-
Constructor Summary
Constructors Constructor Description LogAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoggerContextgetContext()Gets theLoggerContextthat should be used to look up or create loggers.protected org.apache.commons.logging.LognewLogger(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
-
newLogger
protected org.apache.commons.logging.Log newLogger(java.lang.String name, LoggerContext context)Description copied from class:AbstractLoggerAdapterCreates a new named logger for a givenLoggerContext.- Specified by:
newLoggerin classAbstractLoggerAdapter<org.apache.commons.logging.Log>- Parameters:
name- the name of the logger to createcontext- the LoggerContext this logger will be associated with- Returns:
- the new named logger
-
getContext
protected LoggerContext 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.apache.commons.logging.Log>- Returns:
- the LoggerContext to be used for lookup and creation purposes
- See Also:
LogManager.getContext(ClassLoader, boolean),LogManager.getContext(String, boolean)
-
-