Skip to content

Commit 2dc3e81

Browse files
- Changed Debugging Rails Applications doc's logger introduction section. Changed location for specifying logger.
[Prajakta, thiagoaugusto]
1 parent ef06afe commit 2dc3e81

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

guides/source/debugging_rails_applications.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ It can also be useful to save information to log files at runtime. Rails maintai
109109

110110
Rails makes use of the `ActiveSupport::Logger` class to write log information. Other loggers, such as `Log4r`, may also be substituted.
111111

112-
You can specify an alternative logger in `environment.rb` or any other environment file, for example:
112+
You can specify an alternative logger in `config/application.rb`, for example:
113113

114114
```ruby
115-
Rails.logger = Logger.new(STDOUT)
116-
Rails.logger = Log4r::Logger.new("Application Log")
115+
config.logger = Logger.new(STDOUT)
116+
config.logger = Log4r::Logger.new("Application Log")
117117
```
118118

119119
Or in the `Initializer` section, add _any_ of the following
120120

121121
```ruby
122-
config.logger = Logger.new(STDOUT)
123-
config.logger = Log4r::Logger.new("Application Log")
122+
Rails.logger = Logger.new(STDOUT)
123+
Rails.logger = Log4r::Logger.new("Application Log")
124124
```
125125

126126
TIP: By default, each log is created under `Rails.root/log/` and the log file is named after the environment in which the application is running.

0 commit comments

Comments
 (0)