Should Psake have a more pluggable logging mechanism? #65

JamesDawson opened this Issue May 1, 2013 · 3 comments


None yet

4 participants


At present psake outputs it messages using Write-Output which makes them visible in the console as well as redirectable to a file (or any form of other STDOUT redirection).

This means that within your build process if you want to output a message that is visible alongside the psake output you need to use Write-Output too. However, this pollutes the pipeline, which effectively prevents you from doing any logging from within a function that needs to return a value (unless you want play around with extracting the returned value from amongst any log messages).

To avoid polluting the pipeline you can use Write-Host to display a message and whilst this is visible in the console, it won't appear alongside the psake output in any STDOUT redirection.

Equally, any custom logging framework you may be using inside of your powershell (e.g. log to a file, database etc.) will not 'see' any of the psake output, including any unhandled exceptions.

Am I missing something, or do others think there is case for extending psake to support a more pluggable logging mechanism?

damianh commented Mar 31, 2014

Yeah I'd like to see this. Marking it as UpForGrabs.

@damianh damianh added the UpForGrabs label Mar 31, 2014

👍 from me. We've patched log4net onto our local fork of psake.psm1, but it would be much better if there were extensibility hooks to grab onto.

gep13 commented Oct 16, 2014

We've patched log4net onto our local fork of psake.psm1

Do you have any information on how you went about doing this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment