PoShLog.Sinks.EventLog is extension module for PoShLog logging module. Contains sink that publishes log messages to Windows Event Log.
If you are familiar with PowerShell, skip to Installation section. For more detailed installation instructions check out Getting started wiki.
To install PoShLog.Sinks.EventLog, run following snippet from powershell:
Install-Module PoShLog.Sinks.EventLogNote that before first use you should run following as administrator to register your -Source(Sample Script). Notice the -ManageEventSource parameter.
Import-Module PoShLog
Import-Module PoShLog.Sinks.EventLog
New-Logger |
Add-SinkEventLog -Source 'Sample Script' -ManageEventSource $true |
Start-Logger
Close-LoggerAfter that you can run your scripts under default privileges and you can ommit -ManageEventSource parameter, as long as you don't change -Source parameter.
Import-Module PoShLog
Import-Module PoShLog.Sinks.EventLog
New-Logger |
Add-SinkEventLog -Source 'Sample Script' |
Start-Logger
Write-InformationLog 'My message in windows event log'
Close-LoggerThese examples are just to get you started fast. For more detailed documentation please check wiki.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
Serilog.Sinks.EventLog- serilog/serilog-sinks-eventlog- Icon made by Smashicons from www.flaticon.com.
