diff --git a/Gemfile b/Gemfile index 3c7da75d..301ff1a6 100644 --- a/Gemfile +++ b/Gemfile @@ -221,16 +221,15 @@ gem 'selectize-rails' # For collecting performance data gem 'skylight' -# Nokogiri < 1.8.1 is subject to: -# CVE-2017-0663, CVE-2017-7375, CVE-2017-7376, CVE-2017-9047, CVE-2017-9048, -# CVE-2017-9049, CVE-2017-9050 -gem 'nokogiri', '>= 1.8.1' - # memcached binary connector gem 'dalli' +# to generate ical files gem 'icalendar' +# to tame logs +gem 'lograge' + group :development do # for static code analisys gem 'rubocop', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 2fb68c07..ead493fa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -300,6 +300,11 @@ GEM letter_opener (~> 1.7) railties (>= 5.2) rexml + lograge (0.12.0) + actionpack (>= 4) + activesupport (>= 4) + railties (>= 4) + request_store (~> 1.0) loofah (2.19.1) crass (~> 1.0.2) nokogiri (>= 1.5.9) @@ -677,13 +682,13 @@ DEPENDENCIES leaflet-rails letter_opener letter_opener_web + lograge matrix (~> 0.4) mina mini_magick money-rails mysql2 next_rails - nokogiri (>= 1.8.1) omniauth omniauth-facebook omniauth-github diff --git a/config/environments/production.rb b/config/environments/production.rb index a301acc8..5671c653 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -67,6 +67,22 @@ Rails.application.configure do # require "syslog/logger" # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + # Enable lograge + config.lograge.enabled = true + config.lograge.custom_payload do |controller| + # exceptions = ['controller', 'action', 'format', 'id'] + { + # params: event.payload[:params].except(*exceptions), + user: controller.current_user.try(:username) + } + end + config.lograge.custom_options = lambda do |event| + exceptions = %w[controller action format id _method authenticity_token] + { + params: event.payload[:params].except(*exceptions) + } + end + if ENV['RAILS_LOG_TO_STDOUT'].present? logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter