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
formatter[RW]
level[RW]
sync[RW]
Public Class Methods
new(eventlog = nil)
click to toggle source
# File lib/chef/log/winevt.rb, line 45 def initialize(eventlog = nil) @eventlog = eventlog || ::Win32::EventLog.open("Application") end
Public Instance Methods
close()
click to toggle source
# File lib/chef/log/winevt.rb, line 49 def close end
debug(msg)
click to toggle 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
error(msg)
click to toggle 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
fatal(msg)
click to toggle 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
info(msg)
click to toggle 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
warn(msg)
click to toggle 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