Skip to content

Instantly share code, notes, and snippets.

@mdesanti
Created October 27, 2016 12:09
Show Gist options
  • Save mdesanti/155d1fd15c9f38490fba0d208b136eec to your computer and use it in GitHub Desktop.
Save mdesanti/155d1fd15c9f38490fba0d208b136eec to your computer and use it in GitHub Desktop.
Logstasher Configuration
LogStashLogger.configure do |config|
config.customize_event do |event|
hash = event.to_hash
tags = hash['tags']
event['requestId'] = tags.present? ? tags[0] : RequestStore.store[:request_id]
event['subId'] = RequestStore.store[:sub_id]
event['service'] = 'Microservice A'
event['logLevel'] = hash['severity']
event['timestamp'] = Time.now.utc.iso8601(3)
end
end
config.logger = LogStashLogger.new(type: :stdout)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment