diff options
author | danielsdeleo <dan@opscode.com> | 2013-02-24 20:43:55 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-02-27 11:12:15 -0800 |
commit | 634ad58ab14d6cfa05f56991bbc758cc3b22d410 (patch) | |
tree | fbcf778a5c03f7a27400352c0b3a7098c9471aef /lib/chef/application/windows_service.rb | |
parent | b217dc3f2a80866d484a6cad33190dd321b3e2b7 (diff) | |
download | chef-634ad58ab14d6cfa05f56991bbc758cc3b22d410.tar.gz |
[CHEF-3935] Use stripped down lockless logger
Ruby's stdlib Logger wraps all IO in mutexes. Ruby 2.0 doesn't allow you
to request a lock in a trap handler because that could deadlock. This
commit fixes by replacing the Logger with a lock-free variant.
Diffstat (limited to 'lib/chef/application/windows_service.rb')
-rw-r--r-- | lib/chef/application/windows_service.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/application/windows_service.rb b/lib/chef/application/windows_service.rb index 42a9ee9783..5b77a44392 100644 --- a/lib/chef/application/windows_service.rb +++ b/lib/chef/application/windows_service.rb @@ -17,6 +17,7 @@ # require 'chef' +require 'chef/monologger' require 'chef/application' require 'chef/client' require 'chef/config' @@ -194,7 +195,7 @@ class Chef # See application.rb for related comments. def configure_logging - Chef::Log.init(Chef::Config[:log_location]) + Chef::Log.init(MonoLogger.new(Chef::Config[:log_location])) if want_additional_logger? configure_stdout_logger end @@ -202,7 +203,7 @@ class Chef end def configure_stdout_logger - stdout_logger = Logger.new(STDOUT) + stdout_logger = MonoLogger.new(STDOUT) STDOUT.sync = true stdout_logger.formatter = Chef::Log.logger.formatter Chef::Log.loggers << stdout_logger |