All Projects β†’ PoShLog β†’ PoShLog

PoShLog / PoShLog

Licence: MIT license
πŸ”© PoShLog is PowerShell cross-platform logging module. It allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog - https://serilog.net/

Programming Languages

powershell
5483 projects
C#
18002 projects

Projects that are alternatives of or similar to PoShLog

WELA
WELA (Windows Event Log Analyzer): The Swiss Army knife for Windows Event Logs! γ‚‘ηΎ…οΌˆγ‚¦γ‚§γƒ©οΌ‰
Stars: ✭ 442 (+309.26%)
Mutual labels:  log, logs, event
Gollum
An n:m message multiplexer written in Go
Stars: ✭ 883 (+717.59%)
Mutual labels:  log, logger, logs
ptkdev-logger
πŸ¦’ Beautiful Logger for Node.js: the best alternative to the console.log statement
Stars: ✭ 117 (+8.33%)
Mutual labels:  log, logger, logs
Node Lambda Log
Basic logging mechanism for Node 6.10+ Lambda Functions
Stars: ✭ 115 (+6.48%)
Mutual labels:  log, logger, error-reporting
Sgf
This is a Smart Game Foundation (Not Framework)
Stars: ✭ 122 (+12.96%)
Mutual labels:  module, log, event
Golog
A high-performant Logging Foundation for Go Applications. X3 faster than the rest leveled loggers.
Stars: ✭ 208 (+92.59%)
Mutual labels:  log, logger, logs
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-52.78%)
Mutual labels:  log, logger, logs
LogDNA-Android-Client
Android client for LogDNA
Stars: ✭ 22 (-79.63%)
Mutual labels:  log, logger, logs
l
Cross-platform html/io [L]ogger with simple API.
Stars: ✭ 26 (-75.93%)
Mutual labels:  log, logger, logs
elmah.io
ELMAH error logger for sending errors to elmah.io.
Stars: ✭ 31 (-71.3%)
Mutual labels:  error-log, error-reporting
guzzle-log-middleware
A Guzzle middleware to log request and responses automatically
Stars: ✭ 61 (-43.52%)
Mutual labels:  log, logger
ink
A Logger backend that logs JSON
Stars: ✭ 64 (-40.74%)
Mutual labels:  logger, logs
winevt
Windows Event Interactions in Python
Stars: ✭ 59 (-45.37%)
Mutual labels:  logs, event
GoogleCloudLogging
Swift (Darwin) library for logging application events in Google Cloud.
Stars: ✭ 24 (-77.78%)
Mutual labels:  log, logger
Flogs
An Advanced Logging Framework develop in flutter that provides quick & simple logging solution.
Stars: ✭ 158 (+46.3%)
Mutual labels:  logger, logs
addon-log-viewer
Log Viewer - Home Assistant Community Add-ons
Stars: ✭ 37 (-65.74%)
Mutual labels:  log, logs
ratlog.js
πŸ€ Ratlog JavaScript library - Application Logging for Rats, Humans and Machines
Stars: ✭ 24 (-77.78%)
Mutual labels:  logger, logs
paStash
pastaΚƒ'Κƒ = Spaghetti I/O Event Data Processing, Interpolation, Correlation and beyond 🍝
Stars: ✭ 89 (-17.59%)
Mutual labels:  log, logs
apollo-log
A logging extension for the Apollo GraphQL Server
Stars: ✭ 64 (-40.74%)
Mutual labels:  log, logger
log
PSR-3 compatible logger
Stars: ✭ 32 (-70.37%)
Mutual labels:  log, logger

icon

PoShLog

psgallery psgallery Discord Build Status Support

Serilog for powershell

PoShLog is powershell cross-platform logging module. PoShLog allows you to log structured event data into console, file and much more places easily. It's built upon great C# logging library Serilog.

Key Features

  • Structured log event data
  • Clean and easy to use API
  • Cross-platform
  • Easily extensible

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

Install-Module PoShLog

Usage

Setup logger using pipeline fluent API and write some log messages(in this case into file and console):

Import-Module PoShLog

# Create new logger
# This is where you customize where, when and how to log
New-Logger |
    Set-MinimumLevel -Value Verbose | # You can change this value later to filter log messages
    # Here you can add as many sinks as you want - see https://github.com/PoShLog/PoShLog/wiki/Sinks for all available sinks
    Add-SinkConsole |   # Tell logger to write log messages to console
    Add-SinkFile -Path 'C:\Data\my_awesome.log' | # Tell logger to write log messages into file
    Start-Logger

# Test all log levels
Write-VerboseLog 'Test verbose message'
Write-DebugLog 'Test debug message'
Write-InfoLog 'Test info message'
Write-WarningLog 'Test warning message'
Write-ErrorLog 'Test error message'
Write-FatalLog 'Test fatal message'

Close-Logger

poshlog_example_fullversion

For detailed documentation see wiki

You can(and you should) log formatted data:

Write-InfoLog 'Current date and time is {DateTime}' -PropertyValues (Get-Date)

# Some example data
$position = @{
    Latitude = 25
    Longitude = 134
}
$elapsedMs = 34

Write-InfoLog 'Processed {@Position} in {Elapsed:000} ms.' -PropertyValues $position, $elapsedMs

poshlog_example_simplest_console

Fluent API is too bulky? You don't need extra sinks? Use short setup version(logs into console and file):

# Create and start new logger
Start-Logger -FilePath 'C:\Data\my_awesome.log' -Console

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

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

poshlog_example_simplest_console

Extendability

PoShLog is extensible just like Serilog. All available extensions can be found here.

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.

Show your support

  • ⭐ Star the PoShLog repository. This is the least you can do to support this project.
  • πŸ‘ Give us some feedback or suggest features using Discussions or discord
  • πŸ”Ž Test PoShLog and raise issues
  • Contribute πŸš€ you can start with good first issues

Contributors

Authors

Release Notes

License

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

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].