Skip to content

Instantly share code, notes, and snippets.

@troelskn
Last active November 21, 2018 09:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troelskn/e5f9b182af4568826048 to your computer and use it in GitHub Desktop.
Save troelskn/e5f9b182af4568826048 to your computer and use it in GitHub Desktop.
config/initializers/raven.rb
require 'raven'
require 'rake/task'
if Rails.env.production?
Raven.configure do |config|
config.dsn = 'http://xxx:xxx@app.getsentry.com/xxxxx'
end
module Rake
class Task
alias :orig_execute :execute
def execute(args = nil)
Raven.capture :logger => 'rake', :tags => { 'rake_task' => @name } do
orig_execute(args)
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment