Top Description Interfaces Annotations Classes Enums
[default module]

Package org.apache.logging.log4j.message

Annotations
@Export
@Version:2.22.0
Imports
org.osgi.annotation.bundle.Export, org.osgi.annotation.versioning.Version

Public Message Types used for Log4j 2. Users may implement their own Messages.

Interface Summary

Modifier and TypeInterface and Description
pack-priv interface
Clearable

Clearable objects may be reset to a reusable state.

public interface
EntryMessage

Entry flow messages

public interface
ExitMessage

Exit flow messages

public interface
FlowMessage

Flow messages

public interface
FlowMessageFactory

Creates flow messages.

public interface
LoggerNameAwareMessage

Message that is interested in the name of the Logger.

public interface
Message

An interface for various Message implementations that can be logged.

public interface
MessageCollectionMessage<
The Message type.
T
>

A Message that is a collection of Messages.

public interface
MessageFactory

Creates messages.

public interface
MessageFactory2

Creates messages.

public interface
MultiformatMessage

A Message that can render itself in more than one way.

public interface
ParameterConsumer<
state data
S
>

An operation that accepts two input arguments and returns no result.

public interface
ParameterVisitable

Allows message parameters to be iterated over without any allocation or memory copies.

public interface
ReusableMessage

Messages implementing this interface are reused between logging calls.

public interface
ThreadInformation

Interface used to print basic or extended thread information.

public interface
TimestampMessage

Messages that use this interface will cause the timestamp in the message to be used instead of the timestamp in the LogEvent.

Annotation Summary

Modifier and TypeAnnotation and Description
public @interface
AsynchronouslyFormattable

Annotation that signals to asynchronous logging components that messages of this type can safely be passed to a background thread without calling Message#getFormattedMessage() first.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractMessageFactory

Provides an abstract superclass for MessageFactory2 implementations with default implementations (and for MessageFactory by extension).

pack-priv class
BasicThreadInformation

Generates information about the current Thread.

public class
DefaultFlowMessageFactory

Default factory for flow messages.

public class
FormattedMessage

Handles messages that contain a format String.

public class
FormattedMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Note to implementors:

This class implements all MessageFactory2 methods.

public class
LocalizedMessage

Provides some level of compatibility with Log4j 1.x and convenience but is not the recommended way to Localize messages.

public class
LocalizedMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Note to implementors:

This class does not implement any MessageFactory2 methods and lets the superclass funnel those calls through newMessage(String, Object...).

public class
MapMessage<
Allow subclasses to use fluent APIs and override methods that return instances of subclasses.
M extends MapMessage<M, V>
,
The value type
V
>

Represents a Message that consists of a Map.

public class
MessageFormatMessage

Handles messages that consist of a format string conforming to java.text.MessageFormat.

public class
MessageFormatMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Note to implementors:

This class implements all MessageFactory2 methods.

public class
ObjectArrayMessage

Handles messages that contain an Object[].

public class
ObjectMessage

Handles messages that contain an Object.

pack-priv class
ParameterFormatter

Supports parameter formatting as used in ParameterizedMessage and ReusableParameterizedMessage.

public class
ParameterizedMessage

A Message accepting argument placeholders in the formatting pattern.

public class
ParameterizedMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Enables the use of {} parameter markers in message strings.

public class
ParameterizedNoReferenceMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Creates SimpleMessage objects that do not retain a reference to the parameter object.

public class
ReusableMessageFactory

Implementation of the MessageFactory interface that avoids allocating temporary objects where possible.

public class
ReusableObjectMessage

Mutable Message wrapper around an Object message.

public class
ReusableParameterizedMessage

Reusable parameterized message.

public class
ReusableSimpleMessage

Mutable Message wrapper around a String message.

public class
SimpleMessage

The simplest possible implementation of Message.

public class
SimpleMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

This uses is the simplest possible implementation of Message, the where you give the message to the constructor argument as a String.

public class
StringFormattedMessage

Handles messages that consist of a format string conforming to java.util.Formatter.

public class
StringFormatterMessageFactory

Creates FormattedMessage instances for MessageFactory2 methods (and MessageFactory by extension.)

Enables the use of java.util.Formatter strings in message strings.

public class
StringMapMessage

A StringMapMessage typed to String-only values.

public class
StructuredDataCollectionMessage

A collection of StructuredDataMessages.

public class
StructuredDataId

The StructuredData identifier.

public class
StructuredDataMessage

Represents a Message that conforms to an RFC 5424 StructuredData element along with the syslog message.

public class
ThreadDumpMessage

Captures information about all running Threads.

Enum Summary

Modifier and TypeEnum and Description
pack-priv enum
MapMessageJsonFormatter

The default JSON formatter for MapMessages.