Class: Gruf::Interceptors::Instrumentation::RequestLogging::Formatters::Logstash

Inherits:
Base
  • Object
show all
Defined in:
lib/gruf/interceptors/instrumentation/request_logging/formatters/logstash.rb

Overview

Formats logging for gruf services into a Logstash-friendly JSON format

Instance Method Summary collapse

Instance Method Details

#format(payload) ⇒ String

Format the request into a JSON-friendly payload

Parameters:

  • payload (Hash)

    The incoming request payload

Returns:

  • (String)

    The JSON representation of the payload



33
34
35
# File 'lib/gruf/interceptors/instrumentation/request_logging/formatters/logstash.rb', line 33

def format(payload)
  payload.merge(format: 'json').to_json
end