Interface StructuredArgument

All Known Implementing Classes:
DeferredStructuredArgument, EmptyLogstashMarker, MapEntriesAppendingMarker, ObjectAppendingMarker, ObjectFieldsAppendingMarker, RawJsonAppendingMarker, SingleFieldAppendingMarker

public interface StructuredArgument
A wrapper for an argument passed to a log method (e.g. Logger.info(String, Object...)) that adds data to the JSON event (via ArgumentsJsonProvider).
  • Method Summary

    Modifier and Type
    Method
    Description
    Writes the data associated with this argument to a String to be included in a log event's formatted message (via parameter substitution).
    void
    Writes the data associated with this argument to the given JsonGenerator.
  • Method Details

    • writeTo

      void writeTo(JsonGenerator generator) throws IOException
      Writes the data associated with this argument to the given JsonGenerator.
      Parameters:
      generator - the JsonGenerator to produce JSON content
      Throws:
      IOException - if an I/O error occurs
    • toString

      String toString()
      Writes the data associated with this argument to a String to be included in a log event's formatted message (via parameter substitution).

      Note that this will only be included in the log event's formatted message if the message format includes a parameter for this argument.

      Overrides:
      toString in class Object
      Returns:
      String representation of the data associated with this argument