Package | Description |
---|---|
org.apache.logging.log4j |
Public API for Log4j 2.
|
org.apache.logging.log4j.core |
Implementation of Log4j 2.
|
org.apache.logging.log4j.core.async |
Provides Asynchronous Logger classes and interfaces for low-latency logging.
|
org.apache.logging.log4j.message |
Public Message Types used for Log4j 2.
|
org.apache.logging.log4j.simple |
Simple logging implementation.
|
org.apache.logging.log4j.spi |
Internal interfaces and classes to be used by authors of logging implementations or for internal use by
API classes.
|
org.apache.logging.log4j.util |
Internal utility classes for the Log4j 2 API.
|
org.apache.logging.slf4j |
SLF4J support.
|
Modifier and Type | Method and Description |
---|---|
<MF extends MessageFactory> |
Logger.getMessageFactory()
Gets the message factory used to convert message Objects and Strings/CharSequences into actual log Messages.
|
Modifier and Type | Method and Description |
---|---|
static Logger |
LogManager.getLogger(Class<?> clazz,
MessageFactory messageFactory)
Returns a Logger using the fully qualified name of the Class as the Logger name.
|
static Logger |
LogManager.getLogger(MessageFactory messageFactory)
Returns a Logger with the name of the calling class.
|
static Logger |
LogManager.getLogger(Object value,
MessageFactory messageFactory)
Returns a Logger using the fully qualified class name of the value as the Logger name.
|
static Logger |
LogManager.getLogger(String name,
MessageFactory messageFactory)
Returns a Logger with the specified name.
|
Modifier and Type | Method and Description |
---|---|
Logger |
LoggerContext.getLogger(String name,
MessageFactory messageFactory)
Obtains a Logger from the Context.
|
boolean |
LoggerContext.hasLogger(String name,
MessageFactory messageFactory)
Determines if the specified Logger exists.
|
protected Logger |
LoggerContext.newInstance(LoggerContext ctx,
String name,
MessageFactory messageFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
LoggerContext.hasLogger(String name,
Class<? extends MessageFactory> messageFactoryClass)
Determines if the specified Logger exists.
|
Constructor and Description |
---|
Logger(LoggerContext context,
String name,
MessageFactory messageFactory)
The constructor.
|
LoggerProxy(String name,
MessageFactory messageFactory) |
Modifier and Type | Method and Description |
---|---|
protected Logger |
AsyncLoggerContext.newInstance(LoggerContext ctx,
String name,
MessageFactory messageFactory) |
Constructor and Description |
---|
AsyncLogger(LoggerContext context,
String name,
MessageFactory messageFactory,
org.apache.logging.log4j.core.async.AsyncLoggerDisruptor loggerDisruptor)
Constructs an
AsyncLogger with the specified context, name and message factory. |
Modifier and Type | Interface and Description |
---|---|
interface |
MessageFactory2
Creates messages.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractMessageFactory
Provides an abstract superclass for
MessageFactory2 implementations with default implementations (and for
MessageFactory by extension). |
class |
FormattedMessageFactory
|
class |
LocalizedMessageFactory
|
class |
MessageFormatMessageFactory
|
class |
ParameterizedMessageFactory
|
class |
ParameterizedNoReferenceMessageFactory
|
class |
ReusableMessageFactory
Implementation of the
MessageFactory interface that avoids allocating temporary objects where possible. |
class |
SimpleMessageFactory
|
class |
StringFormatterMessageFactory
|
Modifier and Type | Method and Description |
---|---|
ExtendedLogger |
SimpleLoggerContext.getLogger(String name,
MessageFactory messageFactory) |
boolean |
SimpleLoggerContext.hasLogger(String name,
MessageFactory messageFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
SimpleLoggerContext.hasLogger(String name,
Class<? extends MessageFactory> messageFactoryClass) |
Constructor and Description |
---|
SimpleLogger(String name,
Level defaultLevel,
boolean showLogName,
boolean showShortLogName,
boolean showDateTime,
boolean showContextMap,
String dateTimeFormat,
MessageFactory messageFactory,
PropertiesUtil props,
PrintStream stream) |
Modifier and Type | Class and Description |
---|---|
class |
MessageFactory2Adapter
Adapts a legacy MessageFactory to the new MessageFactory2 interface.
|
Modifier and Type | Field and Description |
---|---|
static Class<? extends MessageFactory> |
AbstractLogger.DEFAULT_MESSAGE_FACTORY_CLASS
The default MessageFactory class.
|
Modifier and Type | Method and Description |
---|---|
<MF extends MessageFactory> |
AbstractLogger.getMessageFactory() |
Modifier and Type | Method and Description |
---|---|
MessageFactory |
MessageFactory2Adapter.getOriginal() |
Modifier and Type | Method and Description |
---|---|
static void |
AbstractLogger.checkMessageFactory(ExtendedLogger logger,
MessageFactory messageFactory)
Checks that the message factory a logger was created with is the same as the given messageFactory.
|
static String |
LoggerContextKey.create(String name,
MessageFactory messageFactory)
Deprecated.
|
T |
LoggerRegistry.getLogger(String name,
MessageFactory messageFactory)
Returns an ExtendedLogger.
|
ExtendedLogger |
LoggerContext.getLogger(String name,
MessageFactory messageFactory)
Returns an ExtendedLogger.
|
boolean |
LoggerRegistry.hasLogger(String name,
MessageFactory messageFactory)
Detects if a Logger with the specified name and MessageFactory exists.
|
boolean |
LoggerContext.hasLogger(String name,
MessageFactory messageFactory)
Detects if a Logger with the specified name and MessageFactory exists.
|
void |
LoggerRegistry.putIfAbsent(String name,
MessageFactory messageFactory,
T logger) |
Modifier and Type | Method and Description |
---|---|
static String |
LoggerContextKey.create(String name,
Class<? extends MessageFactory> messageFactoryClass)
Deprecated.
|
boolean |
LoggerRegistry.hasLogger(String name,
Class<? extends MessageFactory> messageFactoryClass)
Detects if a Logger with the specified name and MessageFactory type exists.
|
boolean |
LoggerContext.hasLogger(String name,
Class<? extends MessageFactory> messageFactoryClass)
Detects if a Logger with the specified name and MessageFactory type exists.
|
Constructor and Description |
---|
AbstractLogger(String name,
MessageFactory messageFactory)
Creates a new named logger with a particular
MessageFactory . |
ExtendedLoggerWrapper(ExtendedLogger logger,
String name,
MessageFactory messageFactory)
Constructor that wraps and existing Logger.
|
MessageFactory2Adapter(MessageFactory wrapped) |
Modifier and Type | Method and Description |
---|---|
static Message |
LambdaUtil.getMessage(Supplier<?> supplier,
MessageFactory messageFactory)
Returns a Message, either the value supplied by the specified function, or a new Message created by the specified
Factory.
|
Modifier and Type | Method and Description |
---|---|
ExtendedLogger |
SLF4JLoggerContext.getLogger(String name,
MessageFactory messageFactory) |
boolean |
SLF4JLoggerContext.hasLogger(String name,
MessageFactory messageFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
SLF4JLoggerContext.hasLogger(String name,
Class<? extends MessageFactory> messageFactoryClass) |
Constructor and Description |
---|
SLF4JLogger(String name,
MessageFactory messageFactory,
org.slf4j.Logger logger) |
Copyright © 1999-2017. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.