lograge
lograge copied to clipboard
config.lograge.formatter = Lograge::Formatters::Logstash.new doesn't work
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!
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?