ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <>
Subject RE: How to read a a particular log file and echo the message from "Build.xml" ?
Date Fri, 10 Jun 2005 05:06:35 GMT

-----Original Message-----
Sent: Thursday, June 09, 2005 5:03 PM
To: Ant Users List
Subject: How to read a a particular log file and echo the message from
"Build.xml" ?

>From Build.xml,How to read a  particular log file(which is in the same 
folder) and echo the message of a particular field in the log file  from


Is ant provide those facility andshould i have to read a script for this


1. load file with <loadfile srcfile .... />

2. get the special part | line you want extracted / read in that file
    with (nested) filterchains. You may use head- and tailfilter,
    in conjunction with regular expressions (when using jdk => 1.4 or
    extralibrary jakarta-oro)
    the result may be stored in a property and then 

just have a look in the manual for loadfile, filterchains

Beside that you may also use a script task with 
groovy | javascript | beanshell | netrexx ... if other things don't

But in most cases you don't need a special script.

example :

<loadfile srcfile="./${deploy.folderer}/${your.logfile}"
        <headfilter lines="16"/>
        <tailfilter lines="1"/>
                <replaceregex pattern="(.*):(.*\d\d:\d\d)"

Regards, Gilbert

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message