class Chef::Log::WinEvt
Chef::Log::WinEvt
class. usage in client.rb:
log_location Chef::Log::WinEvt.new
Constants
- DEBUG_EVENT_ID
- ERROR_EVENT_ID
- FATAL_EVENT_ID
- INFO_EVENT_ID
-
These must match those that are defined in the manifest file
- SOURCE
-
Since we must install the event logger, this is not really configurable
- WARN_EVENT_ID
Attributes
Public Class Methods
Source
# File lib/chef/log/winevt.rb, line 46 def initialize(eventlog = nil) @eventlog = eventlog || ::Win32::EventLog.open("Application") end
Public Instance Methods
Source
# File lib/chef/log/winevt.rb, line 70 def debug(msg) @eventlog.report_event( event_type: ::Win32::EventLog::INFO_TYPE, source: SOURCE, event_id: DEBUG_EVENT_ID, data: [msg] ) end
Source
# File lib/chef/log/winevt.rb, line 79 def error(msg) @eventlog.report_event( event_type: ::Win32::EventLog::ERROR_TYPE, source: SOURCE, event_id: ERROR_EVENT_ID, data: [msg] ) end
Source
# File lib/chef/log/winevt.rb, line 88 def fatal(msg) @eventlog.report_event( event_type: ::Win32::EventLog::ERROR_TYPE, source: SOURCE, event_id: FATAL_EVENT_ID, data: [msg] ) end
Source
# File lib/chef/log/winevt.rb, line 52 def info(msg) @eventlog.report_event( event_type: ::Win32::EventLog::INFO_TYPE, source: SOURCE, event_id: INFO_EVENT_ID, data: [msg] ) end
Source
# File lib/chef/log/winevt.rb, line 61 def warn(msg) @eventlog.report_event( event_type: ::Win32::EventLog::WARN_TYPE, source: SOURCE, event_id: WARN_EVENT_ID, data: [msg] ) end