summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/unit/log/syslog_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/unit/log/syslog_spec.rb b/spec/unit/log/syslog_spec.rb
index 36b4a01481..3db90e50c6 100644
--- a/spec/unit/log/syslog_spec.rb
+++ b/spec/unit/log/syslog_spec.rb
@@ -24,9 +24,16 @@ describe "Chef::Log::Syslog", :unix_only => true do
let(:app) { Chef::Application.new }
before do
- Chef::Config[:log_level] = :info
- Chef::Config[:log_location] = syslog
- app.configure_logging
+ Chef::Log.init(MonoLogger.new(syslog))
+ @old_log_level = Chef::Log.level
+ Chef::Log.level = :info
+ @old_loggers = Chef::Log.loggers
+ Chef::Log.use_log_devices([syslog])
+ end
+
+ after do
+ Chef::Log.level = @old_log_level
+ Chef::Log.use_log_devices(@old_loggers)
end
it "should send message with severity info to syslog." do