Class StringFormattedMessage

java.lang.Object
org.apache.logging.log4j.message.StringFormattedMessage
All Implemented Interfaces:
Serializable, Message

public class StringFormattedMessage extends Object implements Message
Handles messages that consist of a format string conforming to Formatter.

Note to implementors:

This class implements the unrolled args API even though StringFormattedMessage does not. This leaves the room for StringFormattedMessage to unroll itself later.

See Also:
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • HASHVAL

      private static final int HASHVAL
      See Also:
    • messagePattern

      private String messagePattern
    • argArray

      private transient Object[] argArray
    • stringArgs

      private String[] stringArgs
    • formattedMessage

      private transient String formattedMessage
    • throwable

      private transient Throwable throwable
    • locale

      private final Locale locale
  • Constructor Details

    • StringFormattedMessage

      public StringFormattedMessage(Locale locale, String messagePattern, Object... arguments)
      Constructs a message.
      Parameters:
      locale - the locale for this message format
      messagePattern - the pattern for this message format
      arguments - The objects to format
      Since:
      2.6
    • StringFormattedMessage

      public StringFormattedMessage(String messagePattern, Object... arguments)
      Constructs a message.
      Parameters:
      messagePattern - the pattern for this message format
      arguments - The objects to format
      Since:
      2.6
  • Method Details