mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Adds additional eventlog write functions
This commit is contained in:
parent
e6b46b84f7
commit
9b947dc069
2 changed files with 17 additions and 0 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
lib/core/logging/Write-IcingaErrorMessage.psm1
Normal file
13
lib/core/logging/Write-IcingaErrorMessage.psm1
Normal 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;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue