lib/ezlog/railtie.rb in ezlog-0.3.1 vs lib/ezlog/railtie.rb in ezlog-0.3.2
- old
+ new
@@ -1,11 +1,10 @@
module Ezlog
class Railtie < Rails::Railtie
initializer 'ezlog.configure_logging' do |app|
- ::Logging.logger.root.appenders = ::Logging.appenders.stdout 'stdout',
- layout: Ezlog::LoggingLayout.new(environment: ::Rails.env),
- level: app.config.log_level
+ ::Logging.logger.root.appenders = ::Logging.appenders.stdout 'stdout', layout: Ezlog::LoggingLayout.new(environment: ::Rails.env)
+ ::Logging.logger.root.level = app.config.log_level
end
initializer 'ezlog.configure_sidekiq_logging' do
initialize_sidekiq_logging if defined? ::Sidekiq
end
@@ -32,10 +31,10 @@
end
private
def initialize_sidekiq_logging
- ::Sidekiq.logger = ::Logging.logger['Sidekiq']
+ ::Sidekiq.logger = Ezlog.logger('Sidekiq')
::Sidekiq.logger.level = :info
::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 }