Class ThreadDumpMessage

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

@AsynchronouslyFormattable public class ThreadDumpMessage extends Object implements Message, StringBuilderFormattable
Captures information about all running Threads.
See Also:
  • Constructor Details

    • ThreadDumpMessage

      public ThreadDumpMessage(String title)
      Generate a ThreadDumpMessage with a title.
      Parameters:
      title - The title.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFormattedMessage

      public String getFormattedMessage()
      Returns the ThreadDump in printable format.
      Specified by:
      getFormattedMessage in interface Message
      Returns:
      the ThreadDump suitable for logging.
    • formatTo

      public void formatTo(StringBuilder sb)
      Description copied from interface: StringBuilderFormattable
      Writes a text representation of this object into the specified StringBuilder, ideally without allocating temporary objects.
      Specified by:
      formatTo in interface StringBuilderFormattable
      Parameters:
      sb - the StringBuilder to write into
    • getFormat

      public String getFormat()
      Returns the title.
      Specified by:
      getFormat in interface Message
      Returns:
      the title.
    • getParameters

      public Object[] getParameters()
      Returns an array with a single element, a Map containing the ThreadInformation as the key. and the StackTraceElement array as the value;
      Specified by:
      getParameters in interface Message
      Returns:
      the "parameters" to this Message.
    • writeReplace

      protected Object writeReplace()
      Creates a ThreadDumpMessageProxy that can be serialized.
      Returns:
      a ThreadDumpMessageProxy.
    • getThrowable

      public Throwable getThrowable()
      Always returns null.
      Specified by:
      getThrowable in interface Message
      Returns:
      null