summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/win32-eventlog/chef-log.man6
-rw-r--r--lib/chef/log/winevt.rb12
2 files changed, 17 insertions, 1 deletions
diff --git a/ext/win32-eventlog/chef-log.man b/ext/win32-eventlog/chef-log.man
index 5e4b6ae074..10c28e739f 100644
--- a/ext/win32-eventlog/chef-log.man
+++ b/ext/win32-eventlog/chef-log.man
@@ -44,6 +44,12 @@ Language=English
.
MessageId=10103
+SymbolicName=ERROR
+Language=English
+[ERROR] %1
+.
+
+MessageId=10104
SymbolicName=FATAL
Language=English
[FATAL] %1
diff --git a/lib/chef/log/winevt.rb b/lib/chef/log/winevt.rb
index e355ff8162..c5b7c3485a 100644
--- a/lib/chef/log/winevt.rb
+++ b/lib/chef/log/winevt.rb
@@ -32,7 +32,8 @@ class Chef
INFO_EVENT_ID = 10100
WARN_EVENT_ID = 10101
DEBUG_EVENT_ID = 10102
- FATAL_EVENT_ID = 10103
+ ERROR_EVENT_ID = 10103
+ FATAL_EVENT_ID = 10104
# Since we must install the event logger, this is not really configurable
SOURCE = 'Chef'
@@ -75,6 +76,15 @@ class Chef
)
end
+ def error(msg)
+ @eventlog.report_event(
+ :event_type => ::Win32::EventLog::ERROR_TYPE,
+ :source => SOURCE,
+ :event_id => ERROR_EVENT_ID,
+ :data => [msg]
+ )
+ end
+
def fatal(msg)
@eventlog.report_event(
:event_type => ::Win32::EventLog::ERROR_TYPE,