Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting ant to log to file as well as screen/terminal

Tags:

logging

ant

I've searched these forums as well as the internet and could not find a clear answer. I'm executing an ant task. I would like the output to get put to the screen as well as a log file ... how can I do this?

like image 443
Christopher Dancy Avatar asked Apr 07 '10 20:04

Christopher Dancy


1 Answers

You should use the ant task <record>. See http://ant.apache.org/manual/Tasks/recorder.html.

In your ant file do something like:

...
<record name="logfile.txt" action="start" append="false" />
...
your ant code...
...
<record name="logfile.txt" action="stop"/>

The output from ant between the two record statements will be written to 'logfile.txt'

like image 189
pablaasmo Avatar answered Oct 30 '22 16:10

pablaasmo