diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-12 06:17:36 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-12 06:17:36 -0700 |
commit | e57f5c1be36f97b7eca886a99d86fd207240bc34 (patch) | |
tree | 7e85fe92951c2d902b6054d9209f4b554a005d81 | |
parent | 6687bae7bede7919dd50c78379425c76fd3fca70 (diff) | |
download | chef-jdm/winevt.tar.gz |
Added errorjdm/winevt
-rw-r--r-- | ext/win32-eventlog/chef-log.man | 6 | ||||
-rw-r--r-- | lib/chef/log/winevt.rb | 12 |
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, |