ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <nagendra.r...@tejasoft.com>
Subject Re: live view of the file contents
Date Wed, 04 Jan 2012 18:16:07 GMT
intent is to automate the viewing of the Server Logs after the server is 
started through ant script..
I can write a ant task which opens the file and prints to the console...

as suggested by you, usage of exec  would any way makes the ant script 
less portable..for one more time.. we want to minimize exec usage as far 
as possible and invent pure java ways..

It may be good for ant to think of some task like tail etc..

Thank you for your inputs and looking forward to more thoughts..

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
On 1/4/2012 10:02 PM, Bruce Atherton wrote:
> On 04/01/2012 1:33 AM, Raja Nagendra Kumar wrote:
>> If we like to open the log file after tomcat starting.. what is the 
>> best way
>> to see the content coming in dos console... as and when some thing is
>> written to log file..
>>
>
> I don't think there is a way to do this strictly with Ant tasks (I 
> would have expected it in the concat task or the tail filter), but 
> from the command line of a Unix system you use:
>
>     tail -f file.log
>
> If you wanted Ant to do that for some reason, you could stick that 
> command in an exec task or use a script to accomplish the same thing. 
> It is a bad idea, though, because it leaves Ant running forever just 
> to watch a log file, and the combination of Java and Ant is quite 
> large. You are better off running the "tail -f" command by itself, 
> from outside of Ant. Perhaps started in a batch file that has 
> previously run Ant.
>
> For Windows, you could install cygwin to get the same program. Or 
> google for other tail programs that have the follow feature.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message