How do I save NAnt log output to a file?
Asked Answered
H

1

6

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.

Hermon answered 26/4, 2009 at 18:43 Comment(0)
L
12

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.

Lodgings answered 26/4, 2009 at 19:12 Comment(1)
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?Buffybuford

© 2022 - 2024 — McMap. All rights reserved.