Permalink
Browse files

use logging-bugsnag.

  • Loading branch information...
1 parent a59b504 commit ccbe068bc1e39e091c25c97101442bc382ea7134 @koshigoe committed Apr 18, 2015
View
@@ -44,3 +44,4 @@ gem 'dotenv-rails'
gem 'bugsnag'
gem 'logging-rails'
+gem 'logging-bugsnag'
View
@@ -73,6 +73,9 @@ GEM
logging (2.0.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
+ logging-bugsnag (0.1.1)
+ bugsnag
+ logging
logging-rails (0.5.0)
logging (>= 1.8)
loofah (2.0.1)
@@ -157,6 +160,7 @@ DEPENDENCIES
dotenv-rails
jbuilder (~> 2.0)
jquery-rails
+ logging-bugsnag
logging-rails
pg
rails (= 4.2.1)
@@ -5,6 +5,11 @@ class NotesController < ApplicationController
# GET /notes.json
def index
@notes = Note.all
+ logger.debug '-- DEBUG --'
+ logger.info '-- INFO --'
+ logger.warn '-- WARN --'
+ logger.error '-- ERROR --'
+ logger.fatal '-- FATAL --'
end
# GET /notes/1
@@ -40,7 +40,7 @@
# config.action_view.raise_on_missing_translations = true
# Set the logging destination(s)
- config.log_to = %w[stdout file]
+ config.log_to = %w[stdout file bugsnag]
# Show the logging configuration on STDOUT
config.show_log_configuration = true
@@ -78,7 +78,7 @@
config.active_record.dump_schema_after_migration = false
# Set the logging destination(s)
- config.log_to = %w[file]
+ config.log_to = %w[file bugsnag]
# Show the logging configuration on STDOUT
config.show_log_configuration = false
@@ -1,3 +1,4 @@
Bugsnag.configure do |config|
config.api_key = ENV['BUGSNAG_API_KEY']
+ config.logger = ActiveSupport::Logger.new(Rails.root.join('log/bugsnag.log'))
end
View
@@ -49,6 +49,8 @@
:layout => layout
) if config.log_to.include? 'file'
+ Logging.appenders.bugsnag('bugsnag', level: :error) if config.log_to.include? 'bugsnag'
+
=begin
# NOTE: You will need to install the `logging-email` gem to use this appender
# with loggging-2.0. The email appender was extracted into a plugin gem. That

0 comments on commit ccbe068

Please sign in to comment.