Package org.apache.logging.log4j.message
Class ParameterizedNoReferenceMessageFactory
- java.lang.Object
-
- org.apache.logging.log4j.message.AbstractMessageFactory
-
- org.apache.logging.log4j.message.ParameterizedNoReferenceMessageFactory
-
- All Implemented Interfaces:
java.io.Serializable,MessageFactory,MessageFactory2
public final class ParameterizedNoReferenceMessageFactory extends AbstractMessageFactory
CreatesFormattedMessageinstances forMessageFactory2methods (andMessageFactoryby extension.)Creates
SimpleMessageobjects that do not retain a reference to the parameter object.Intended for use by the
StatusLogger: this logger retains a queue of recently logged messages in memory, causing memory leaks in web applications. (LOG4J2-1176)This class is immutable.
Note to implementors
This class does not implement any
MessageFactory2methods and lets the superclass funnel those calls throughnewMessage(String, Object...).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ParameterizedNoReferenceMessageFactoryINSTANCEInstance of ParameterizedStatusMessageFactory.
-
Constructor Summary
Constructors Constructor Description ParameterizedNoReferenceMessageFactory()Constructs a message factory with default flow strings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagenewMessage(java.lang.String message, java.lang.Object... params)CreatesSimpleMessageinstances containing the formatted parameterized message string.-
Methods inherited from class org.apache.logging.log4j.message.AbstractMessageFactory
newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage
-
-
-
-
Field Detail
-
INSTANCE
public static final ParameterizedNoReferenceMessageFactory INSTANCE
Instance of ParameterizedStatusMessageFactory.
-
-
Method Detail
-
newMessage
public Message newMessage(java.lang.String message, java.lang.Object... params)
CreatesSimpleMessageinstances containing the formatted parameterized message string.- Parameters:
message- The message pattern.params- The message parameters.- Returns:
- The Message.
- See Also:
MessageFactory.newMessage(String, Object...)
-
-