lib/semantic_logger/railtie.rb in semantic_logger-0.3.1 vs lib/semantic_logger/railtie.rb in semantic_logger-0.3.2
- old
+ new
@@ -54,15 +54,19 @@
# Set the default log level based on the Rails config
SemanticLogger::Logger.default_level = config.log_level
# Replace the default Rails loggers
Rails.logger = config.logger = SemanticLogger::Logger.new(Rails)
- if defined?(ActiveRecord)
+ if defined?(ActiveRecord::Base)
ActiveRecord::Base.logger = SemanticLogger::Logger.new(ActiveRecord)
end
- if defined?(ActionController)
+ if defined?(ActionController::Base)
ActionController::Base.logger = SemanticLogger::Logger.new(ActionController)
end
+ if defined?(ActiveResource::Base)
+ ActiveResource::Base.logger = SemanticLogger::Logger.new(ActiveResource)
+ end
+
SemanticLogger::Logger.logger.info "SemanticLogger initialized"
end
end
end