ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Logging and listeners
Date Tue, 25 Feb 2003 17:24:53 GMT
Not fully tested, but you can use the Log4jListener. One Appender
will print to STDOUT and one to file.

Quick hack and quicker test:

build.xml
-------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<project name="test" basedir="." default="main">
    <target name="main">
        <echo>Hello World</echo>
    </target>
</project>


log4j.properties
-------------------------------------------------------
# Configuration Appender "STDOUT"
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%m%n
log4j.appender.STDOUT.threshold=WARN

# Configuration Appender "FILE"
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%-5p (%F:%L): %m%n
log4j.appender.FILE.file=ant.log

# Which Appender to use
log4j.rootLogger=DEBUG, STDOUT, FILE



start
-------------------------------------------------------
ant -listener org.apache.tools.ant.listener.Log4jListener
-Dlog4j.configuration=log4j.properties




Jan Matèrne


-----Urspr√ľngliche Nachricht-----
Von: Boucart_Nick@emc.com [mailto:Boucart_Nick@emc.com]
Gesendet am: Dienstag, 25. Februar 2003 17:40
An: user@ant.apache.org
Betreff: Logging and listeners

Hi,

I have a question about the logging ant supplies:

I would like to have the output from an ant build session both on screen and
in a file: specifiying ant -logfile <file> gives me a nice overview of all
activities of the build script, but I cannot follow the progress on screen.
Note that I work on a win2k box, so a "tail -f" is not an option. I already
looked to the log4j logger, but this listener does not produce the same
output as it is generated via the default logging.

Does ant provide the possibility to have the logging go both to the console
and to the logfile?

Thanks,

Nick.


Nick Boucart
Quality Assurance Engineer
EMC Belgium Development Group

Phone: +32 15 401 416
Fax:     +32 15 401 400
mailto:boucart_nick@emc.com

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message