Bugs: Browse | Submit New | Admin

[#29391] Writing a log file by default to ruby-aws.log does not allow multiple processes to run out of the same dir.

Date:
2011-09-30 16:49
Priority:
3
Submitted By:
Glenn Rempe (grempe)
Assigned To:
Nobody (None)
Category:
Core Library
State:
Open
Summary:
Writing a log file by default to ruby-aws.log does not allow multiple processes to run out of the same dir.

Detailed description
If multiple processes (e.g. rails rake tasks) that instantiate the ruby-aws lib are running from the same base dir many
will fail as they cannot share the Logger file that this lib insists on writing.

The code does not allow passing in of a Logger instance, or turning off the logging functionality altogether.

I was forced to monkey patch the library in order for it to work for me:


module Amazon
  module Util
    module Logging

      def log( str )
        #set_log 'ruby-aws.log' if @@AmazonLogger.nil?
        #@@AmazonLogger.debug str
      end

    end
  end
end

Please allow for passing in a Ruby logger instance (e.g. Rails.logger) as part of the initialization, and please also
allow passing in a nil or false as part of the initialization to turn off logging altogether if desired.

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item