[EMAIL PROTECTED] wrote:


When executing a nant script from at .bat file, I redirect ALL output to a log file as follows:

I can't address the unhandled exception, but it's important to correct an error in understanding:

nant -buildfile:.\CPI\BuildCPI.xml -D:CPICodeRoot="%GADOECodeRoot%" -D:CurrentVSSLabel=%CurrentVSSLabel% %LogLevel% %NANTTARGETS% >> %BuildDetailLog%

This does NOT redirect all output. Console programs have two output streams, stdout and stderr. This command only directs the output to stdout, not the output to stderr. That's why you're still seeing it.

Depending upon what you want, you can redirect stderr in one of two ways:

  nant ... >build.log  2>build.err

will send the stderr output to a different file.

 nant ... >build.log 2>&1

will put the stderr into the same file as stdout, at the correct point in the output (more or less).

The first way makes it easier to see whether or not any errors occurred (since status codes and NAnt failure messages don't always work the way you expect, as you've shown here). The second way is useful when the error message doesn't have enough context to figure out the point in the build at which the error is occurring.

Gary



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
NAnt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to