I am writing a project currently in Ruby that uses the ActiveRecord XML interface to interact with the database, and I am trying to register all database activity using an attribute ActiveRecord::Base.loggerwith the following code
ActiveRecord::Base.logger = Logger.new(File.open('logs/database.log', 'a'))
This works great for porting, etc. (for some reason, it seems that it requires logging to be turned on, because it generated a NilClass error when it was turned off), but when I try to start a project that includes a streaming daemon that calls an ActiveRecord object, w370> not executed with the following error
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/logger.rb:504:in `write': closed stream (IOError)
Any ideas on how to solve this problem would be greatly appreciated. At the moment, I began to look at other code to find out if other ways to implement ActiveRecord registration in a more thread-safe mode.
thanks
Patrick
source
share