summaryrefslogtreecommitdiff
path: root/lib/chef/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/application.rb')
-rw-r--r--lib/chef/application.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index 81637eabb8..7f9dd426a8 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -202,10 +202,12 @@ class Chef
end
end
- # Based on config and whether or not STDOUT is a tty, should we setup a
- # secondary logger for stdout?
+ # we do NOT want an addition logger if:
+ # - log_location is the default (nobody has redirected to logfile or syslogd or whatevs)
+ # - STDOUT is closed
+ # - we are running explicitly daemonized
def want_additional_logger?
- Chef::Config.is_default?(:log_location) && Chef::Config[:log_location].tty? && !Chef::Config[:daemonize]
+ !(Chef::Config.is_default?(:log_location) || STDOUT.closed? || Chef::Config[:daemonize])
end
def configure_stdout_logger