lib/ezlog/railtie.rb in ezlog-0.9.1 vs lib/ezlog/railtie.rb in ezlog-0.9.5
- old
+ new
@@ -3,17 +3,21 @@
config.ezlog = ActiveSupport::OrderedOptions.new
config.ezlog.enable_sequel_logging = false
config.ezlog.log_only_whitelisted_params = false
config.ezlog.whitelisted_params = [:controller, :action]
config.ezlog.exclude_paths = []
+ config.ezlog.initial_context = { environment: ::Rails.env }
+ config.ezlog.layout_options = {}
initializer "ezlog.initialize" do
require "ezlog/rails/extensions"
end
initializer 'ezlog.configure_logging' do |app|
- ::Logging.logger.root.appenders = ::Logging.appenders.stdout 'stdout', layout: Ezlog::LoggingLayout.new(environment: ::Rails.env)
+ ::Logging.logger.root.appenders =
+ ::Logging.appenders.stdout 'stdout', layout: Ezlog::LoggingLayout.new(app.config.ezlog.initial_context,
+ app.config.ezlog.layout_options)
::Logging.logger.root.level = app.config.log_level
end
initializer 'ezlog.configure_sidekiq' do |app|
initialize_sidekiq_logging(app) if defined? ::Sidekiq
@@ -65,9 +69,10 @@
::Sidekiq.logger.level = app.config.log_level
::Sidekiq.configure_server do |config|
config.options[:job_logger] = Ezlog::Sidekiq::JobLogger
config.error_handlers << Ezlog::Sidekiq::ErrorLogger.new
config.error_handlers.delete_if { |handler| handler.is_a? ::Sidekiq::ExceptionHandler::Logger }
+ config.death_handlers << Ezlog::Sidekiq::DeathLogger.new
end
end
def disable_rack_timeout_logging
::Rack::Timeout::Logger.logger = ::Logger.new(nil)