shadabahmed / logstasher

Awesome rails logs
MIT License
822 stars 136 forks source link

logging json errors #15

Open corehook opened 10 years ago

corehook commented 10 years ago

Hi. I want to save all response json errors into @fields in initializer.

My logstasher.rb

if Rails.env.staging? || Rails.env.production?
  LogStasher.add_custom_fields do |fields|
    fields[:node] = nodename=`hostname`[0..-2]
    fields[:user] = current_user
    fields[:env] = Rails.env
    fields[:json_errors] = request.json_erros (??? HOW)
    LogStasher.custom_fields << :myapi_runtime
  end
end
bf4 commented 10 years ago

What does that mean? What JSON error? Is this still and issue?