From 89c5d85ba084b617ae73e01e1ae269aed6cd228d Mon Sep 17 00:00:00 2001 From: f Date: Sat, 3 Feb 2018 19:40:29 -0300 Subject: [PATCH] recibir errores por mail --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/environments/production.rb | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/Gemfile b/Gemfile index f0a6ec3..91d4789 100644 --- a/Gemfile +++ b/Gemfile @@ -37,6 +37,7 @@ gem 'bootstrap', '~> 4.0.0.beta3' gem 'jekyll' gem 'jquery-rails' gem 'font-awesome-rails' +gem 'exception_notification' group :development, :test do gem 'pry' diff --git a/Gemfile.lock b/Gemfile.lock index 446786a..f0c3843 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,6 +94,9 @@ GEM erubi (1.7.0) erubis (2.7.0) eventmachine (1.2.5) + exception_notification (4.2.2) + actionmailer (>= 4.0, < 6) + activesupport (>= 4.0, < 6) execjs (2.7.0) ffi (1.9.18) font-awesome-rails (4.7.0.2) @@ -284,6 +287,7 @@ DEPENDENCIES capybara (~> 2.13) dotenv-rails email_address + exception_notification font-awesome-rails haml-rails jbuilder (~> 2.5) diff --git a/config/environments/production.rb b/config/environments/production.rb index 09bc44c..5d3ad7d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -84,4 +84,18 @@ Rails.application.configure do # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Recibir por mail notificaciones de excepciones + config.action_mailer.default_url_options = { host: 'sutty.kefir.red' } + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = true + config.action_mailer.delivery_method = :sendmail + config.action_mailer.default_options = { from: 'sutty@kefir.red' } + + config.middleware.use ExceptionNotification::Rack, + email: { + email_prefix: '[ERROR]', + sender_address: %(sutty@kefir.red), + exception_recipients: 'sysadmin@kefir.red' + } end