From 0f3d426a16037d968f12a73b86c798def0588073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Fri, 10 Feb 2012 21:59:58 +0100 Subject: Make log autoflushing configurable --- railties/lib/rails/application/bootstrap.rb | 2 +- railties/lib/rails/application/configuration.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/application/bootstrap.rb b/railties/lib/rails/application/bootstrap.rb index efc7dca0d4..93a0fba10b 100644 --- a/railties/lib/rails/application/bootstrap.rb +++ b/railties/lib/rails/application/bootstrap.rb @@ -30,7 +30,7 @@ module Rails f = File.open path, 'a' f.binmode - f.sync = true # make sure every write flushes + f.sync = config.autoflush_log # if true make sure every write flushes logger = ActiveSupport::TaggedLogging.new( ActiveSupport::Logger.new(f) diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 0297c41274..3144e1d3cb 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -5,7 +5,7 @@ require 'rails/engine/configuration' module Rails class Application class Configuration < ::Rails::Engine::Configuration - attr_accessor :allow_concurrency, :asset_host, :asset_path, :assets, + attr_accessor :allow_concurrency, :asset_host, :asset_path, :assets, :autoflush_log, :cache_classes, :cache_store, :consider_all_requests_local, :console, :dependency_loading, :exceptions_app, :file_watcher, :filter_parameters, :force_ssl, :helpers_paths, :logger, :log_tags, :preload_frameworks, @@ -41,6 +41,7 @@ module Rails @file_watcher = ActiveSupport::FileUpdateChecker @exceptions_app = nil @default_method_for_update = :put + @autoflush_log = !Rails.env.production? @assets = ActiveSupport::OrderedOptions.new @assets.enabled = false -- cgit v1.2.3