diff --git a/lib/core/logging/Icinga_EventLog_Enums.psm1 b/lib/core/logging/Icinga_EventLog_Enums.psm1 index 30cd05b..2b9c9e5 100644 --- a/lib/core/logging/Icinga_EventLog_Enums.psm1 +++ b/lib/core/logging/Icinga_EventLog_Enums.psm1 @@ -7,7 +7,12 @@ #> [hashtable]$IcingaEventLogEnums += @{ 'Framework' = @{ - # TODO: Add event log messages + 1000 = @{ + 'EntryType' = 'Information'; + 'Message' = 'Generic debug message issued by the Framework or its components'; + 'Details' = 'The Framework or is components can issue generic debug message in case the debug log is enabled. Please ensure to disable it, if not used. You can do so with the command "Disable-IcingaFrameworkDebugMode"'; + 'EventId' = 1000; + }; } }; diff --git a/lib/core/logging/Write-IcingaDebugMessage.psm1 b/lib/core/logging/Write-IcingaDebugMessage.psm1 index 187765c..419e290 100644 --- a/lib/core/logging/Write-IcingaDebugMessage.psm1 +++ b/lib/core/logging/Write-IcingaDebugMessage.psm1 @@ -1,7 +1,8 @@ function Write-IcingaDebugMessage() { param( - [string]$Message + [string]$Message, + [array]$Objects = @() ); if ([string]::IsNullOrEmpty($Message)) { @@ -12,5 +13,8 @@ function Write-IcingaDebugMessage() return; } - Write-EventLog -LogName Application -Source 'Icinga for Windows' -EntryType Information -EventId 1000 -Message $Message; + [array]$DebugContent = @($Message); + $DebugContent += $Objects; + + Write-IcingaEventMessage -EventId 1000 -Namespace 'Framework' -Objects $DebugContent; }