How to save NAnt log output to a file

loggingnant

In my build script how can I set a destination for NAnt's log messages?

Idealy I'd like to just specify a file path. Then, on each build, NAnt would overwrite this file's contents with its message output.

Best Solution

You can use NANT Loggers and Listeners for that. One option is to pass a logfile parameter to the command. This file is overwritten on every execution.

You could have a batch file that calls NAnt for each build file and corresponding output.

NAnt.exe -build:[build file for PROJ1] -logfile:c:\temp\BuildOutput1.txt
NAnt.exe -build:[build file for PROJ2] -logfile:c:\temp\BuildOutput2.txt
.
.

I would suggest you look into at a Continuous Integration app, like CruiseControl.NET if you haven't already done so.