Skip to content
Browse files

Allow the selected environment to define RAILS_DEFAULT_LOGGER, and ha…

…ve Rails::Initializer use it if it exists.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2134 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent bfdb437 commit 9eef247339c1cc08de7be3d9f7ac9048cb62adcc @jamis jamis committed Sep 5, 2005
Showing with 6 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +4 −1 railties/lib/initializer.rb
View
2 railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Allow the selected environment to define RAILS_DEFAULT_LOGGER, and have Rails::Initializer use it if it exists.
+
* Moved all the shared tasks from Rakefile into Rails, so that the Rakefile is empty and doesn't require updating.
* Added Rails::Initializer and Rails::Configuration to abstract all of the common setup out of config/environment.rb (uses config/boot.rb to bootstrap the initializer and paths)
View
5 railties/lib/initializer.rb
@@ -61,6 +61,9 @@ def initialize_database
end
def initialize_logger
+ # if the environment has explicitly defined a logger, use it
+ return if defined?(RAILS_DEFAULT_LOGGER)
+
begin
logger = Logger.new(configuration.log_path)
logger.level = configuration.log_level
@@ -182,4 +185,4 @@ def default_controller_paths
[ File.join(RAILS_ROOT, 'app', 'controllers'), File.join(RAILS_ROOT, 'components') ]
end
end
-end
+end

0 comments on commit 9eef247

Please sign in to comment.
Something went wrong with that request. Please try again.