From a0ac12caf12d453d36f8a78569bf470ab6ecb9cf Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 May 2009 14:40:08 -0700 Subject: Consistent logger assignment for multiple objects Bah, it's so much busy work to deal with this as configuration option. Maybe I should say we allow any logger the user wants, as long as it's $stderr :P --- lib/unicorn.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 8a74f97..f43bb0f 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -144,6 +144,10 @@ module Unicorn def stdout_path=(path); redirect_io($stdout, path); end def stderr_path=(path); redirect_io($stderr, path); end + def logger=(obj) + REQUEST.logger = @logger = obj + end + # sets the path for the PID file of the master process def pid=(path) if path @@ -580,7 +584,6 @@ module Unicorn @config.commit!(self) kill_each_worker(:QUIT) Unicorn::Util.reopen_logs - REQUEST.logger = @logger @app = @orig_app build_app! if @preload_app logger.info "done reloading config_file=#{@config.config_file}" -- cgit v1.2.3-24-ge0c7