Created
June 17, 2014 14:44
-
-
Save ploegert/4b3db52fb5a4ac9468d2 to your computer and use it in GitHub Desktop.
Setup Log4Net/Log4Posh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Write-Verbose -Verbose:$ShowVerbose "BEGIN: log4net configuration definition" | |
| $log = New-Log4Posh -Configuration "C:\Program Files\WindowsPowerShell\Modules\poshcat\log4posh\log4net.config" -Dll "C:\Program Files\WindowsPowerShell\Modules\poshcat\log4posh\log4net.dll" -Verbose:$ShowVerbose | |
| $location = [System.Net.Dns]::GetHostName() | |
| [log4net.NDC]::Push($location); | |
| $location = Split-Path (Split-Path $myInvocation.MyCommand.path) -Leaf | |
| [log4net.NDC]::Push($location); | |
| $Log = [log4net.LogManager]::GetLogger($Host.GetType()) | |
| Write-Verbose -Verbose:$ShowVerbose "END: log4net configuration definition" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment