wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes how to create a log file for ant? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "how to create a log file for ant?" Watch "how to create a log file for ant?" New topic
Author

how to create a log file for ant?

gow tham
Greenhorn

Joined: Sep 29, 2013
Posts: 29
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

Joined: Jul 26, 2007
Posts: 10175
    
    8

Check out http://ant.apache.org/manual/Tasks/recorder.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
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.


Ping & DNS - my free Android networking tools app
gow tham
Greenhorn

Joined: Sep 29, 2013
Posts: 29
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
Ranch Hand

Joined: Aug 27, 2012
Posts: 1037
    
  10

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
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
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

Joined: Sep 29, 2013
Posts: 29
Thank you maneesh and all for your replies....

I have step-in to my goal....!!!
 
wood burning stoves
 
subject: how to create a log file for ant?
 
Similar Threads
I'm not able to run Junit suites in ant
Ant build giving errors
Deploying war file
Javac error
Ant Build Failing -- Need a way to pick jar file during run time.