Uses of Interface
org.apache.logging.log4j.message.MessageFactory
Package
Description
Public API for Log4j 2.
Public Message Types used for Log4j 2.
Simple logging implementation.
Internal interfaces and classes to be used by authors of logging implementations or for internal use by
API classes.
Status API for Log4j 2.
Internal utility classes for the Log4j 2 API.
-
Uses of MessageFactory in org.apache.logging.log4j
Modifier and TypeMethodDescription<MF extends MessageFactory>
MFLogger.getMessageFactory()
Gets the message factory used to convert message Objects and Strings/CharSequences into actual log Messages.Modifier and TypeMethodDescriptionstatic 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
(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.static Logger
LogManager.getLogger
(MessageFactory messageFactory) Returns a Logger with the name of the calling class. -
Uses of MessageFactory in org.apache.logging.log4j.message
Modifier and TypeClassDescriptionclass
Provides an abstract superclass forMessageFactory2
implementations with default implementations (and forMessageFactory
by extension).class
class
class
final class
final class
final class
Implementation of theMessageFactory
interface that avoids allocating temporary objects where possible.final class
final class
-
Uses of MessageFactory in org.apache.logging.log4j.simple
Modifier and TypeMethodDescriptionSimpleLoggerContext.getLogger
(String name, MessageFactory messageFactory) boolean
SimpleLoggerContext.hasLogger
(String name, MessageFactory messageFactory) Modifier and TypeMethodDescriptionboolean
SimpleLoggerContext.hasLogger
(String name, Class<? extends MessageFactory> messageFactoryClass) ModifierConstructorDescriptionSimpleLogger
(String name, Level defaultLevel, boolean showLogName, boolean showShortLogName, boolean showDateTime, boolean showContextMap, String dateTimeFormat, MessageFactory messageFactory, PropertiesUtil props, PrintStream stream) -
Uses of MessageFactory in org.apache.logging.log4j.spi
Modifier and TypeClassDescriptionclass
Adapts a legacy MessageFactory to the new MessageFactory2 interface.Modifier and TypeFieldDescriptionstatic final Class<? extends MessageFactory>
AbstractLogger.DEFAULT_MESSAGE_FACTORY_CLASS
The default MessageFactory class.Modifier and TypeMethodDescription<MF extends MessageFactory>
MFAbstractLogger.getMessageFactory()
Modifier and TypeMethodDescriptionstatic 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) Gets an ExtendedLogger using the fully qualified name of the Class as the Logger name.LoggerContext.getLogger
(String name, MessageFactory messageFactory) Gets an ExtendedLogger.LoggerRegistry.getLogger
(String name, MessageFactory messageFactory) Returns an ExtendedLogger.boolean
LoggerContext.hasLogger
(String name, MessageFactory messageFactory) Tests if a Logger with the specified name and MessageFactory exists.boolean
LoggerRegistry.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 TypeMethodDescriptionstatic String
LoggerContextKey.create
(String name, Class<? extends MessageFactory> messageFactoryClass) Deprecated.boolean
LoggerContext.hasLogger
(String name, Class<? extends MessageFactory> messageFactoryClass) Tests if a Logger with the specified name and MessageFactory type exists.boolean
LoggerRegistry.hasLogger
(String name, Class<? extends MessageFactory> messageFactoryClass) Detects if a Logger with the specified name and MessageFactory type exists.ModifierConstructorDescriptionAbstractLogger
(String name, MessageFactory messageFactory) Creates a new named logger with a particularMessageFactory
.ExtendedLoggerWrapper
(ExtendedLogger logger, String name, MessageFactory messageFactory) Constructor that wraps and existing Logger.MessageFactory2Adapter
(MessageFactory wrapped) -
Uses of MessageFactory in org.apache.logging.log4j.status
ModifierConstructorDescriptionStatusLogger
(String name, MessageFactory messageFactory, StatusLogger.Config config, StatusConsoleListener fallbackListener) Constructs an instance using given properties. -
Uses of MessageFactory in org.apache.logging.log4j.util
Modifier and TypeMethodDescriptionstatic 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.