Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 2.76 KB

README.md

File metadata and controls

84 lines (52 loc) · 2.76 KB

PoShLog.Sinks.Syslog

psgallery PowerShell Gallery psgallery Discord

PoShLog.Sinks.Syslog is an extension module for PoShLog logging module. It contains a sink that publishes log messages to syslog servers.

Getting started

If you are familiar with PowerShell, skip to Installation section. For more detailed installation instructions check out Getting started wiki.

Installation

To install PoShLog.Sinks.Syslog, run following snippet from powershell:

Install-Module PoShLog.Sinks.Syslog

Usage

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

Documentation

These examples are just to get you started fast. For more detailed documentation please check wiki.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits