lib/ezlog/railtie.rb in ezlog-0.5.0 vs lib/ezlog/railtie.rb in ezlog-0.5.1
- old
+ new
@@ -29,11 +29,13 @@
end
config.after_initialize do
Ezlog::Rails::LogSubscriber.detach ::ActionController::LogSubscriber
Ezlog::Rails::LogSubscriber.detach ::ActionView::LogSubscriber
- Ezlog::Rails::LogSubscriber.detach ::ActiveRecord::LogSubscriber
- Ezlog::Rails::LogSubscriber.attach Ezlog::Rails::ActiveRecord::LogSubscriber, :active_record
+ if defined? ::ActiveRecord
+ Ezlog::Rails::LogSubscriber.detach ::ActiveRecord::LogSubscriber
+ Ezlog::Rails::LogSubscriber.attach Ezlog::Rails::ActiveRecord::LogSubscriber, :active_record
+ end
end
config.before_configuration do |app|
app.config.logger = Ezlog.logger('Application')
app.config.log_level = ENV['LOG_LEVEL'] || :info