tags:

views:

829

answers:

1

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.

+2  A: 

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.

Jose Basilio
I've seen the documentation. I'm also planning on TeamCity for my CI. I'm still not sure how to get from your suggestion to my goal. Can you explain a little more about how I can configure the default logger to write to a file instead of the console from within my build script?
TheDeeno
I updated my post. Hopefully that helps.
Jose Basilio
It did. Thank you.
TheDeeno