From 40fadd79cee6a26fc124ad42297754b88d5c59e5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 2 Mar 2009 19:27:44 -0800 Subject: Allow stderr_path and stdout_path to be set in the config As opposed to doing this in the shell, this allows the files to be reopened reliably after rotation. While we're at it, use $stderr/$stdout instead of STDERR/STDOUT since they seem to be more favored. --- lib/unicorn.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 998f8b8..d5867b1 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -90,6 +90,9 @@ module Unicorn listen(Const::DEFAULT_LISTENER) if @listeners.empty? self.pid = @config[:pid] build_app! if @preload_app + $stderr.reopen(@stderr_path, "a") if @stderr_path + $stdout.reopen(@stdout_path, "a") if @stdout_path + $stderr.sync = $stdout.sync = true spawn_missing_workers self end -- cgit v1.2.3-24-ge0c7