Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create a log file for ant?

 
gow tham
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I want to create a log file after the ant execution, and It (Log file)should has all the traces that is performed during ant execution.

Please share yours ideas with me to achieve this task.

The following are the successful ant execution:

F:\folders\sasi\junit_ant>ant
Buildfile: F:\folders\sasi\junit_ant\build.xml

clean:
[delete] Deleting directory F:\folders\sasi\junit_ant\class
[delete] Deleting directory F:\folders\sasi\junit_ant\result
[delete] Deleting directory F:\folders\sasi\junit_ant\bin

init:
[mkdir] Created dir: F:\folders\sasi\junit_ant\class
[mkdir] Created dir: F:\folders\sasi\junit_ant\result
[mkdir] Created dir: F:\folders\sasi\junit_ant\bin

compile:
[javac] Compiling 1 source file to F:\folders\sasi\junit_ant\class

jar:
[jar] Building jar: F:\folders\sasi\junit_ant\bin\launch.jar

run:
[java] The integration project closed successfully

main:

BUILD SUCCESSFUL
Total time: 24 seconds

F:\folders\sasi\junit_ant>

I want to store the above traces as log file in particular folder automatically, after the execution.


Please guide me to reach my goal.

Thanks in advance.

Regards,
Santhosh
 
Maneesh Godbole
Saloon Keeper
Posts: 11088
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or something like "ant > log.txt", although then you won't see the output on the screen.

"ant > log.txt & type log.txt" will show the output after the command has been completed.
 
gow tham
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Maneesh, and Dittmer for your's quick reply.

Maneesh - I will go through the link which is posted by you.


Thanks,
Santhosh.
 
Richard Tookey
Bartender
Posts: 1166
17
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Or something like "ant > log.txt", although then you won't see the output on the screen.



If one uses 'tee' then one can put the output into a file and see it on the screen .

ant | tee log.txt
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, but I did not want to get into installing additional software. For me personally, no Windows installation is complete without Unxutils or something like that, but I realize that's not everyone's cup of tea.
 
gow tham
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you maneesh and all for your replies....

I have step-in to my goal....!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic