Skip to content

Instantly share code, notes, and snippets.

@brianr
Created September 17, 2020 05:03
Show Gist options
  • Save brianr/30fe5afbdaede6503c0a98c0a3af5684 to your computer and use it in GitHub Desktop.
Save brianr/30fe5afbdaede6503c0a98c0a3af5684 to your computer and use it in GitHub Desktop.
# ensure you have rollbar in your Gemfile, e.g.: gem 'rollbar'
require 'rollbar'
Rollbar.configure do |config|
# configure with your project access token (a post_server_item token from the rollbar setup UI)
config.access_token = 'your_token_here'
# To only log internal ERROR-level internal messages from rollbar-gem
config.logger_level = 'error' # default is 'info', meaning INFO and above
# To completely disable the internal rollbar-gem logger:
config.logger = Logger.new('/dev/null')
end
# Send a message to your Rollbar project
Rollbar.error('hello world')
puts 'script complete'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment