Package | Description |
---|---|
org.apache.logging.log4j |
Public API for Log4j 2.
|
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.
|
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 | 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.
|
default ExtendedLogger |
LoggerContext.getLogger(Class<?> cls,
MessageFactory messageFactory)
Returns an ExtendedLogger using the fully qualified name of the Class as the Logger name.
|
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.
|
Copyright © 1999-1969 The Apache Software Foundation. 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.