#108
Tracking Errors with Sentry
12-3-2017
Summary
Sentry is an Open Source error tracking that helps developers monitor and fix crashes in real time. Learn how to add and configure Sentry to your application.
7
rails
error
7:44
Summary
Sentry is an Open Source error tracking that helps developers monitor and fix crashes in real time. Learn how to add and configure Sentry to your application.
7
Resources
Configuring a Sentry Server on Ubuntu 16.04 LTS - https://blog.driftingruby.com/configuring-a-sentry-server-on-ubuntu-16-04-lts/
Sentry Website - https://sentry.io
Source - https://github.com/driftingruby/108-tracking-errors-with-sentry
Summary
Gemfilegem 'sentry-raven'config/initializers/sentry.rbRaven.configure do |config|
config.dsn = 'https://7e4ed0cd459a4368bcf12f319bdde289:[email protected]/253803'
config.sanitize_fields = Rails.application.config.filter_parameters.map(&:to_s)
config.release = APP_VERSION
end
application_controller.rbclass ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :set_raven_context
private
def set_raven_context
Raven.user_context(id: session[:current_user_id], foo: :bar)
Raven.extra_context(params: params.to_unsafe_h, url: request.url)
end
end
config/application.rbrequire_relative 'boot'
require 'rails/all'
require_relative 'version'
...