commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Durham <>
Subject [logging]
Date Tue, 31 Aug 2004 15:11:09 GMT
For some reason, no log4j log files are being generated when I run a 
JUnit task.

The code is simple enough:

    public static final Log log = LogFactory.getLog(AccountTest.class);



Here are my Ant targets:

        <!-- Start Unit Test Targets -->
    <target name="tests.compile" depends=",prepare.tests">
        <!-- Compile the test sources -->
        <javac destdir="${tests.classes}" srcdir="${tests.src}">
                <pathelement path="${classpath}"/>
                <pathelement path="${application.dest.classes}"/>

    <target name="">
        <!--  If logs were generated, copy to buildTemp  -->
        <move todir="${tests.logs}" overwrite="true">
            <fileset dir="." includes="*.log"/>
        <!--  create a unit test report  -->
        <junitreport todir="${tests.reports}">
            <fileset dir="${tests.reports}" includes="TEST-*.xml"/>
            <report format="frames" todir="${tests.reports}/html"/>

    <target name="" depends="tests.compile" 
description="Executes unit tests.">
            <!-- Execute the unit tests -->
        <junit printsummary="on" failureproperty="testsFailed" >
            <formatter type="xml"/>
                <pathelement path="${classpath}"/>
                <pathelement path="${application.dest.classes}"/>
                <pathelement path="${tests.classes}"/>
            <batchtest todir="${tests.reports}">
                <fileset dir="${tests.classes}">
                    <include name="**/*"/>
        <antcall target=""/>
        <!-- End Unit Test Targets -->

Within ${application.dest.classes} is a file.  
${classpath} refers to a bunch of jar files (commons-logging, log4j, 
etc.) and, btw, I do get a Junit report, but no logging and I can't seem 
to write to System.out either.

I'm running Ant from the command line.

Can anyone spot something obviously wrong with this?

I posted this question on the Ant user list, but did not receive a response.  I would post
to JUnit, but it's a  yahoo group and I can't get to it from work because of a proxy.  Thanks
for any help.

- Dave

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

View raw message