Interface StructuredHttpLogFormatter

All Superinterfaces:
HttpLogFormatter

@API(status=EXPERIMENTAL)
public interface StructuredHttpLogFormatter
extends HttpLogFormatter
  • Method Summary

    Modifier and Type Method Description
    java.lang.String format​(java.util.Map<java.lang.String,​java.lang.Object> content)
    Renders properties of an HTTP message into a JSON string.
    default java.lang.String format​(Correlation correlation, HttpResponse response)  
    default java.lang.String format​(Precorrelation precorrelation, HttpRequest request)  
    default java.util.Map<java.lang.String,​java.lang.Object> prepare​(Correlation correlation, HttpResponse response)
    Produces a map of individual properties from an HTTP response.
    default java.util.Map<java.lang.String,​java.lang.Object> prepare​(Precorrelation precorrelation, HttpRequest request)
    Produces a map of individual properties from an HTTP request.
    default java.util.Optional<java.lang.Object> prepareBody​(HttpMessage message)  
    default java.util.Optional<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> prepareHeaders​(HttpMessage message)  
  • Method Details

    • format

      default java.lang.String format​(Precorrelation precorrelation, HttpRequest request) throws java.io.IOException
      Specified by:
      format in interface HttpLogFormatter
      Throws:
      java.io.IOException
    • format

      default java.lang.String format​(Correlation correlation, HttpResponse response) throws java.io.IOException
      Specified by:
      format in interface HttpLogFormatter
      Throws:
      java.io.IOException
    • format

      java.lang.String format​(java.util.Map<java.lang.String,​java.lang.Object> content) throws java.io.IOException
      Renders properties of an HTTP message into a JSON string.
      Parameters:
      content - individual parts of an HTTP message
      Returns:
      the whole message as a JSON object
      Throws:
      java.io.IOException - if writing JSON output fails
      See Also:
      prepare(Precorrelation, HttpRequest), prepare(Correlation, HttpResponse)
    • prepare

      default java.util.Map<java.lang.String,​java.lang.Object> prepare​(Precorrelation precorrelation, HttpRequest request) throws java.io.IOException
      Produces a map of individual properties from an HTTP request.
      Parameters:
      precorrelation - the correlation
      request - the request
      Returns:
      a map containing HTTP request attributes
      Throws:
      java.io.IOException - if reading body fails
      See Also:
      prepare(Correlation, HttpResponse), format(Map)
    • prepare

      default java.util.Map<java.lang.String,​java.lang.Object> prepare​(Correlation correlation, HttpResponse response) throws java.io.IOException
      Produces a map of individual properties from an HTTP response.
      Parameters:
      correlation - the correlation
      response - the response
      Returns:
      a map containing HTTP response attributes
      Throws:
      java.io.IOException - if reading body fails
      See Also:
      prepare(Correlation, HttpResponse), format(Map)
    • prepareHeaders

      default java.util.Optional<java.util.Map<java.lang.String,​java.util.List<java.lang.String>>> prepareHeaders​(HttpMessage message)
    • prepareBody

      default java.util.Optional<java.lang.Object> prepareBody​(HttpMessage message) throws java.io.IOException
      Throws:
      java.io.IOException