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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterizedNoReferenceMessageFactoryInstance of ParameterizedStatusMessageFactory. -
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
-
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:
-