Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rollbar | |
import logging | |
# Needed if you use rollbar.report_exc_info | |
import sys | |
class RollbarLogObserver(object): | |
def __init__(self, rollbar_access_token, env="development", level=logging.INFO): | |
self.level = level | |
rollbar.init(rollbar_access_token, env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
# ... | |
before_filter :check_for_default_route | |
class DefaultRouteException < Exception | |
# Placeholder exception so that we can report request & person data back | |
# to rollbar | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Download rollbar.js and rollbar.min.js from: | |
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.js | |
// http://d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.min.js | |
// | |
// Place them into vendor/ and this code into lib/rollbar.js, or something | |
(function(w, d) { | |
w._rollbarParams = { | |
"server.environment": "production", | |
"notifier.snippet_version": "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Group by Distribution | |
hosts: all | |
tasks: | |
- group_by: key=${ansible_distribution} | |
- name: Set Time Zone | |
hosts: Ubuntu | |
gather_facts: False | |
tasks: | |
- name: Set timezone variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I am trying out Ratchet.io and I want to add their deployment notification to my | |
# normal capistrano deployment process. Here is my first working attempt. | |
# Add this task to your deploy.rb | |
namespace :rollbar do | |
task :notify, :roles => [:web] do | |
set :revision, `git log -n 1 --pretty=format:"%H"` | |
set :local_user, `whoami` | |
set :rollbar_token, YOUR_ACCESS_TOKEN | |
rails_env = fetch(:rails_env, 'production') |