PoShLog.Sinks.Syslog is an extension module for PoShLog logging module. It contains a sink that publishes log messages to syslog servers.
If you are familiar with PowerShell, skip to Installation section. For more detailed installation instructions check out Getting started wiki.
To install PoShLog.Sinks.Syslog, run following snippet from powershell:
Install-Module PoShLog.Sinks.Syslog
This starts UPD syslog logger. You can change the RFC format, port number or other things trough the optional parameters:
Import-Module PoShLog
Import-Module PoShLog.Sinks.Syslog
New-Logger |
Add-SinkSyslogUdp -Hostname '192.168.0.48' |
Start-Logger
Write-InformationLog 'My message in UDP syslog'
Close-Logger
The TCP syslog logger is automatically configured to use TLS 1.2. If you want no TLS or another protocol you got to change it:
Import-Module PoShLog
Import-Module PoShLog.Sinks.Syslog
New-Logger |
Add-SinkSyslogTcp -Hostname '192.168.0.48' -SecureProtocols None |
Start-Logger
Write-InformationLog 'My message in insecure TCP syslog'
Close-Logger
The Local syslog logger writes messages to the local syslog service. This is only available on Linux systems.
Import-Module PoShLog
Import-Module PoShLog.Sinks.Syslog
New-Logger |
Add-SinkSyslogLocal |
Start-Logger
Write-InformationLog 'My message in local syslog'
Close-Logger
These 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.
- Thanks to Tomáš Bouda for making PoShLog.
- Icon made by Smashicons from www.flaticon.com.