Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 95052 invoked from network); 23 Feb 2011 09:22:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Feb 2011 09:22:34 -0000 Received: (qmail 67082 invoked by uid 500); 23 Feb 2011 09:22:33 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 66825 invoked by uid 500); 23 Feb 2011 09:22:30 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 66817 invoked by uid 99); 23 Feb 2011 09:22:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Feb 2011 09:22:29 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of t.dt.aanderson@gmail.com designates 209.85.218.45 as permitted sender) Received: from [209.85.218.45] (HELO mail-yi0-f45.google.com) (209.85.218.45) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Feb 2011 09:22:22 +0000 Received: by yib18 with SMTP id 18so59908yib.4 for ; Wed, 23 Feb 2011 01:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=XYRATOA05YQcgiSMGSS2GShhKrPvIKLgm+gQX1MjKKc=; b=bOw2mZY7LM4ctb8WiPF4j5SrGn03WN7PSdLb1wPhx7QHZ0EXK48cQUII//JPSmftVu 9SQnMqeLGCGrfs0zR2rrxqMOJVWKTUCw0XNQpXlShRuc5vDvAs8f3eX8Sby9EfKbwQWN FV8njt4Z8f042vbyvenLy4k8bR3JL4rmxB/Kc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Pmz/6Dz1C+6xe0vxErsUSiV45tb+AZtglc+QbSorIiGWFBIY7QJRIiWSOwCXx9hkj9 Hem+aapuOPS6D8lKUx5Cl1Cwg6EX6aYvaTFYy/tA6/10jQaWrp4fCkj4vH+xNR5DqV66 jsbL5MxN2M8h5bn4GA4Jo9MVTIyY00UHUUqko= MIME-Version: 1.0 Received: by 10.151.95.16 with SMTP id x16mr3615563ybl.50.1298452921979; Wed, 23 Feb 2011 01:22:01 -0800 (PST) Received: by 10.147.124.1 with HTTP; Wed, 23 Feb 2011 01:22:01 -0800 (PST) In-Reply-To: References: Date: Wed, 23 Feb 2011 17:22:01 +0800 Message-ID: Subject: Re: log4j seems not read by ant From: Thomas Anderson To: user@ant.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok. I know what goes wrong now. For debug log4j with ant, it is jvmarg instead of arg needed to be added within java tag. log4j.properties is not read because there is another project which also uses log4j logging system that I was not aware of. And that classpath property is preceded before my log4j.properties. Wrong classpath Worked version .... Now everything works well. Thanks. On Wed, Feb 23, 2011 at 4:27 PM, Thomas Anderson wrote: > I have a build.xml file which will read log4j.properties, stored in > conf, from conf and log message to another dir e.g. logs/file.log > > My build file's classpath points to conf and then when launch the > application it will have classpath provided. > > =A0 > =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0... > =A0 =A0 > > And in target run, it provides with classpath > > =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 > > > The content of log4j.properties > > log4j.rootLogger =3D DEBUG, RRX > > log4j.rootLogger =3D INFO, LOGFILE > > log4j.appender.LOGFILE=3Dorg.apache.log4j.FileAppender > log4j.appender.LOGFILE.File=3Dmessage.log > log4j.appender.LOGFILE.layout=3Dorg.apache.log4j.Pattern Layout > log4j.appender.LOGFILE.layout.ConversionPattern=3D%d %-5p %c - %m%n > > However, it seems ant does not read log4j.properties so no message is > written to file. > > I supply ant with -Dlog4j.debug in the target run or in command line > directly e.g. ant run -Dlog4j.debug, but there is no different. How > can I check if log4j property is read from config or not? Or how to > fix this problem? > > Thanks. > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org