lograge icon indicating copy to clipboard operation
lograge copied to clipboard

config.lograge.formatter = Lograge::Formatters::Logstash.new doesn't work

Open i5okie opened this issue 7 years ago • 1 comments

Rails 4.2 Ruby 2.3.7

# Gemfile
...
gem 'lograge'
gem 'lograge-tagged'
...

# production.rb
...
  config.lograge.enabled = true
  config.lograge.formatter = Lograge::Formatters::Logstash.new
...

log output:

[request.app] method=GET path=/ format=html controller=UsersController action=index status=200 duration=52.55 view=51.05 db=0.25 params={"controller"=>"users", "action"=>"index"}

neither does config.lograge.formatter = Lograge::Formatters::Json.new, same output as above

Was scratching my head and almost pulling hair out with our production app with existing Lograge config. (Adding logstash formatter) just wasn't working. So made test app with same ruby and rails version and still doesn't work.. Please help!

i5okie avatar Oct 15 '18 16:10 i5okie

Looks like this gem: lograge-tagged breaks this: https://github.com/dnsimple/lograge-tagged/blob/master/lib/lograge_tagged.rb#L18

Is there any built-in functionality to get the tagged logs?

i5okie avatar Oct 15 '18 17:10 i5okie