Class ParameterizedNoReferenceMessageFactory
java.lang.Object
org.apache.logging.log4j.message.AbstractMessageFactory
org.apache.logging.log4j.message.ParameterizedNoReferenceMessageFactory
- All Implemented Interfaces:
Serializable, MessageFactory, MessageFactory2
Creates
FormattedMessage instances for MessageFactory2 methods (and MessageFactory by
extension.)
Creates SimpleMessage objects 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 MessageFactory2 methods and lets the superclass funnel those calls
through newMessage(String, Object...).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classMessage implementation that only keeps a reference to the error text and the error (if any), not to the message parameters, in order to avoid memory leaks. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterizedNoReferenceMessageFactoryInstance of ParameterizedStatusMessageFactory.private static final long -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a message factory with default flow strings. -
Method Summary
Modifier and TypeMethodDescriptionnewMessage(String message, Object... params) CreatesSimpleMessageinstances containing the formatted parameterized message string.Methods inherited from class AbstractMessageFactory
newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage, newMessage
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
INSTANCE
Instance of ParameterizedStatusMessageFactory.
-
-
Constructor Details
-
ParameterizedNoReferenceMessageFactory
public ParameterizedNoReferenceMessageFactory()Constructs a message factory with default flow strings.
-
-
Method Details
-
newMessage
CreatesSimpleMessageinstances containing the formatted parameterized message string.- Parameters:
message- The message pattern.params- The message parameters.- Returns:
- The Message.
- See Also:
-