Skip to content

Extension module for PoShLog logging module. Contains lot of helpful enricher methods, useful when enriching log messages with more properties.

License

Notifications You must be signed in to change notification settings

PoShLog/PoShLog.Enrichers

Repository files navigation

PoShLog.Enrichers

psgallery PowerShell Gallery psgallery Discord

PoShLog.Enrichers is extension module for PoShLog logging module. Contains lot of helpful enricher methods, useful when enriching log messages with more properties.

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.Enrichers, run following snippet from powershell:

Install-Module -Name PoShLog.Enrichers

Usage

Import-Module PoShLog
Import-Module PoShLog.Enrichers

New-Logger |
    Add-EnrichWithEnvironment |
    Add-EnrichWithExceptionDetails |
    Add-SinkConsole -OutputTemplate "[{MachineName} {Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}" |
    Start-Logger

Write-InfoLog 'Hurrray, my first log message!'

# Don't forget to close the logger
Close-Logger

Outputs(Notice the machine name added automatically):

[DESKTOP-PQ6409S 11:16:20 INF] Hurrray, my first log message!

All cmdlets

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

About

Extension module for PoShLog logging module. Contains lot of helpful enricher methods, useful when enriching log messages with more properties.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published