aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/initializer.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index f06b03b784..7cdef2b199 100644
--- a/railties/CHANGELOG
+++ b/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)
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 37669adb42..13a1e1308a 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -61,6 +61,9 @@ module Rails
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 @@ module Rails
[ File.join(RAILS_ROOT, 'app', 'controllers'), File.join(RAILS_ROOT, 'components') ]
end
end
-end \ No newline at end of file
+end