Adds additional eventlog write functions

This commit is contained in:
Christian Stein 2020-03-24 20:07:34 +01:00
parent e6b46b84f7
commit 9b947dc069
2 changed files with 17 additions and 0 deletions

View file

@ -4,6 +4,10 @@ function Write-IcingaDebugMessage()
[string]$Message [string]$Message
); );
if ([string]::IsNullOrEmpty($Message)) {
return;
}
if ($global:IcingaDaemonData.DebugMode -eq $FALSE) { if ($global:IcingaDaemonData.DebugMode -eq $FALSE) {
return; return;
} }

View file

@ -0,0 +1,13 @@
function Write-IcingaErrorMessage()
{
param(
[int]$EventId = 0,
[string]$Message = $null
);
if ($EventId -eq 0 -Or [string]::IsNullOrEmpty($Message)) {
return;
}
Write-EventLog -LogName Application -Source 'Icinga for Windows' -EntryType Error -EventId $EventId -Message $Message;
}