aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
authorRajinder Yadav <devguy.ca@gmail.com>2010-11-09 04:31:08 -0500
committerRajinder Yadav <devguy.ca@gmail.com>2010-11-09 04:31:08 -0500
commit26d314ed6a678e3af38d4caa3483f11f36061333 (patch)
treec66143bf964e55d5ad2c8d0562c68f3324d1dc1a /railties/guides/source
parent4b7ac55780bc5bb4c65bb9fc45b7607b67dc64d6 (diff)
parent645f5158432b541948bcb3e3745cce18ab257df2 (diff)
downloadrails-26d314ed6a678e3af38d4caa3483f11f36061333.tar.gz
rails-26d314ed6a678e3af38d4caa3483f11f36061333.tar.bz2
rails-26d314ed6a678e3af38d4caa3483f11f36061333.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/debugging_rails_applications.textile8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile
index 6eec18b8b9..adf427147b 100644
--- a/railties/guides/source/debugging_rails_applications.textile
+++ b/railties/guides/source/debugging_rails_applications.textile
@@ -127,8 +127,8 @@ Rails makes use of Ruby's standard +logger+ to write log information. You can al
You can specify an alternative logger in your +environment.rb+ or any environment file:
<ruby>
-ActiveRecord::Base.logger = Logger.new(STDOUT)
-ActiveRecord::Base.logger = Log4r::Logger.new("Application Log")
+Rails.logger = Logger.new(STDOUT)
+Rails.logger = Log4r::Logger.new("Application Log")
</ruby>
Or in the +Initializer+ section, add _any_ of the following
@@ -142,13 +142,13 @@ TIP: By default, each log is created under +Rails.root/log/+ and the log file na
h4. Log Levels
-When something is logged it's printed into the corresponding log if the log level of the message is equal or higher than the configured log level. If you want to know the current log level you can call the +ActiveRecord::Base.logger.level+ method.
+When something is logged it's printed into the corresponding log if the log level of the message is equal or higher than the configured log level. If you want to know the current log level you can call the +Rails.logger.level+ method.
The available log levels are: +:debug+, +:info+, +:warn+, +:error+, and +:fatal+, corresponding to the log level numbers from 0 up to 4 respectively. To change the default log level, use
<ruby>
config.log_level = Logger::WARN # In any environment initializer, or
-ActiveRecord::Base.logger.level = 0 # at any time
+Rails.logger.level = 0 # at any time
</ruby>
This is useful when you want to log under development or staging, but you don't want to flood your production log with unnecessary information.