Skip to content

Commit

Permalink
make config compatible with servlet setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Mar 16, 2011
1 parent 974f621 commit 30931df
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/slf4r/slf4r_railtie.rb
@@ -1,9 +1,6 @@
class Slf4rRailtie < Rails::Railtie

config.before_configuration do |app|
#if defined?(Slf4r)
# require 'slf4r/ruby_logger' unless defined?(::Slf4r::LoggerFacade)
#end
initializer "set_servlet_logger", :after => :initialize_logger do |app|
if defined?(Slf4r::LoggerFacade)
@logger = (Rails.logger = setup_logger(Rails))
app.config.logger = @logger
Expand All @@ -17,12 +14,7 @@ class Slf4rRailtie < Rails::Railtie
else
@logger.instance_variable_get(:@logger).class
end

end
end

config.after_initialize do |app|
unless defined?(Slf4r::LoggerFacade)
else
require 'slf4r/wrapped_logger'
Slf4r::LoggerFacade4WrappedLogger.logger = Rails.logger
puts "setup slf4r logger wrapper"
Expand Down

0 comments on commit 30931df

Please sign in to comment.