class Gruf::Interceptors::Instrumentation::RequestLogging::Formatters::Logstash

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

Public Instance Methods

format(payload, request:, result:) click to toggle source

Format the request into a JSON-friendly payload

@param [Hash] payload The incoming request payload @param [Gruf::Controllers::Request] request The current controller request @param [Gruf::Interceptors::Timer::Result] result The timed result of the response @return [String] The JSON representation of the payload

# File lib/gruf/interceptors/instrumentation/request_logging/formatters/logstash.rb, line 37
def format(payload, request:, result:)
  payload.merge(format: 'json').to_json
end