Tuesday, March 29, 2011

New Project: PoshLogger

 

New on Codeplex @ http://poshlogger.codeplex my project to create a good, easy, unified logger for powerShell scripts, and PowerShell applications. I started with a script that Joel Bennet posted on poshcode.org and next thing you know I had a simple logger that I have been using in my internal projects on a day to day basis. If your looking for a logger jump in and help create a really great Logging Experience in PowerShell. My thanks to Joel for the Idea and thanks to the log4net team for the object model.

Import-Module PoshLogger

$Mylogger = Get-Logger -Name 'Test 123' -ConsoleLog -EventLog -RollingFileLog -Folder ".\Logs"
Set-DefaultLogger -Logger $MyLogger

Push-LogContext -Name "My Context"
Write-Log -Message "Logging This To Many Various Target" -LogLevel 'INFO'
Pop-Location

No comments:

Post a Comment