feat: add datadog integration and lograge JSON logs formatting

This commit is contained in:
Karol Sójko
2020-07-28 18:26:41 +02:00
parent d7260e8ea7
commit c2ac21be9d
11 changed files with 76 additions and 40 deletions

View File

@@ -14,6 +14,10 @@ class ApplicationController < ActionController::Base
rescue_from ActionView::MissingTemplate do |exception|
end
def route_not_found
render :json => {:error => {:message => "Not found."}}, :status => 404
end
protected
def allow_iframe
@@ -24,4 +28,19 @@ class ApplicationController < ActionController::Base
cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?
end
def append_info_to_payload(payload)
super
unless payload[:status]
return
end
payload[:level] = 'INFO'
if payload[:status] >= 500
payload[:level] = 'ERROR'
elsif payload[:status] >= 400
payload[:level] = 'WARN'
end
end
end