icinga-powershell-framework/lib/core/logging/Register-IcingaEventLog.psm1
2022-01-21 18:40:32 +01:00

16 lines
630 B
PowerShell

function Register-IcingaEventLog()
{
param (
[string]$LogName = $null
);
if ([string]::IsNullOrEmpty($LogName)) {
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Framework' -ErrorAction SilentlyContinue;
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Service' -ErrorAction SilentlyContinue;
New-EventLog -LogName 'Icinga for Windows' -Source 'IfW::Debug' -ErrorAction SilentlyContinue;
} else {
$LogName = [string]::Format('IfW::{0}', $LogName);
New-EventLog -LogName 'Icinga for Windows' -Source $LogName -ErrorAction SilentlyContinue;
}
}