summaryrefslogtreecommitdiffstats
path: root/lib/puppet/rails.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-09 23:15:01 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-07-09 23:15:01 +0000
commiteabe0d1c31052c1fa3cb67cd8950d964cb137a19 (patch)
tree45208aae9fa55263be4caae90388522fa222ba17 /lib/puppet/rails.rb
parentd36d0cf16939851f62bd45d3a79e87f483470eb2 (diff)
downloadpuppet-eabe0d1c31052c1fa3cb67cd8950d964cb137a19.tar.gz
puppet-eabe0d1c31052c1fa3cb67cd8950d964cb137a19.tar.xz
puppet-eabe0d1c31052c1fa3cb67cd8950d964cb137a19.zip
Fixing #710 -- you can now specify the rails_loglevel
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2667 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails.rb')
-rw-r--r--lib/puppet/rails.rb9
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":