Log the Output from your MSBuild Tasks

In an automated build process, you always need logs as reference for troubleshooting because the task is scheduled and running under the context of a different user, so you won’t be able to see console output.

If you use MSBuild to run your build tasks, here is how to get it to write to a text file when it runs:

msbuild mybuildroutines.msbuild /p:Desitination=WebServer /t:DeployAndTestWebServerBuild /l:FileLogger,Microsoft.Build.Engine;logfile=c:\temp\DeployAndTestWebServerBuild.log

Thanks to Miles for discovering this incredibly useful feature.

This entry was posted in MSBuild. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *