diff options
Diffstat (limited to 'lib/puppet/rails.rb')
-rw-r--r-- | lib/puppet/rails.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb index b68e7d352..670c622eb 100644 --- a/lib/puppet/rails.rb +++ b/lib/puppet/rails.rb @@ -12,6 +12,13 @@ module Puppet::Rails Puppet.config.use(:main, :rails, :puppetmasterd) ActiveRecord::Base.logger = Logger.new(Puppet[:railslog]) + begin + loglevel = Logger.const_get(Puppet[:rails_loglevel].upcase) + ActiveRecord::Base.logger.level = loglevel + rescue => detail + Puppet.warning "'%s' is not a valid Rails log level; using debug" % Puppet[:rails_loglevel] + ActiveRecord::Base.logger.level = Logger::DEBUG + end ActiveRecord::Base.allow_concurrency = true ActiveRecord::Base.verify_active_connections! @@ -28,7 +35,7 @@ module Puppet::Rails # The arguments for initializing the database connection. def self.database_arguments - args = {:adapter => Puppet[:dbadapter]} + args = {:adapter => Puppet[:dbadapter], :log_level => Puppet[:rails_loglevel]} case Puppet[:dbadapter] when "sqlite3": |