Log backtrace on exceptions

This commit is contained in:
Paul Chavard 2018-08-13 16:55:02 +02:00
parent 9de3e6e74b
commit c7b97073ee

View file

@ -6,6 +6,7 @@ Rails.application.configure do
# injected by ansible.
if !config.lograge.custom_options
config.lograge.custom_options = lambda do |event|
exception_object = event.payload[:exception_object]
{
type: 'tps',
user_id: event.payload[:user_id],
@ -14,7 +15,8 @@ Rails.application.configure do
user_agent: event.payload[:user_agent],
browser: event.payload[:browser],
browser_version: event.payload[:browser_version],
platform: event.payload[:platform]
platform: event.payload[:platform],
backtrace: exception_object ? exception_object.backtrace.join("\n") : nil
}.compact
end