Skip to content

wormt/PsLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PsLogger

Structured logging PowerShell module.

Synopsis

  • OTel numeric severity logs
  • Writes JSONL output.
  • Export logs to Loki via tailing JSONL logs. Vector included for this in compose.
  • Push spans/traces over OTLP. Measure time to execute script blocks.
  • Console output still works normally. WinEvent if you're a goofy guy.

Quick start

# set environment variables for OTel.
$env:PSLOGGER_SERVICENAME = "MyApp"
$env:PSLOGGER_SERVICEVERSION = "1.2.3"
$env:PSLOGGER_ENVIRONMENT = "production"

Import-Module ./PsLogger.psm1

# Write a log file
Write-Logger -Message "something happened" -Level 9 -LogFilePath ./out.log

# pipe from New-Logger
New-Logger -Message "test" -Level 13 | Write-Logger -LogFilePath ./out.log

podman compose up -d
# localhost:3000

About

Structured logging PowerShell module with JSONL formatted logfiles for OpenTelemetry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors