Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 398 invoked from network); 9 Mar 2006 12:14:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Mar 2006 12:14:01 -0000 Received: (qmail 45495 invoked by uid 500); 9 Mar 2006 12:13:57 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 45465 invoked by uid 500); 9 Mar 2006 12:13:57 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 45453 invoked by uid 99); 9 Mar 2006 12:13:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2006 04:13:56 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [64.14.253.135] (HELO goku.simulalabs.com) (64.14.253.135) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Mar 2006 04:13:56 -0800 Received: by goku.simulalabs.com (Postfix, from userid 501) id 36FE9EC0404; Thu, 9 Mar 2006 04:13:37 -0800 (PST) Received: from localhost (goku [127.0.0.1]) by goku.simulalabs.com (Postfix) with ESMTP id 117D3EC0403 for ; Thu, 9 Mar 2006 04:13:37 -0800 (PST) Received: from goku.simulalabs.com ([127.0.0.1]) by localhost (goku.simulalabs.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 12552-05 for ; Thu, 9 Mar 2006 04:13:34 -0800 (PST) Received: from [172.16.240.135] (unknown [172.16.240.135]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by goku.simulalabs.com (Postfix) with ESMTP id 5B359EC03E7 for ; Thu, 9 Mar 2006 04:13:32 -0800 (PST) Message-ID: <44101BD7.5050508@worldonline.fr> Date: Thu, 09 Mar 2006 13:13:11 +0100 From: Guillaume Nodet User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: activemq-dev@geronimo.apache.org Subject: Re: [IDE malarkey] dealing with log4j in your IDE versus Maven References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at goku.simulalabs.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N In ServiceMix, i solved the problem by specifying another log4j configuration that is used in maven only. Just add the following lines in the project.properties maven.junit.sysproperties=log4j.configuration log4j.configuration=log4j-tests.properties and magically, maven tests will be run using log4j-tests.properties and the IDE will use default log4j.properties. Guillaume James Strachan wrote: > This might be completely obvious to everyone - but I just thought I'd > explain what I've just started doing with my IDE and I wished I'd > done this a long long time ago... > > So ActiveMQ uses log4j.properties on the classpath (usually in > $module/src/test/resources/). By default the logging level is INFO > and it goes to a log file so that when you run the maven build it > doesn't fill the screen with lots of garbage. (Incidentally some > tests are timing sensitive, so setting logging level to DEBUG will > often cause some tests to fail as debug logging slows things down so > much) > > However when running stuff in your IDE - e.g. working on a specific > test case or program, you often want output to the console so you see > it nicely in your IDE. Often you want debug too. > > So for the longest time I've been hacking, say, the activemq-core/src/ > test/resources/log4j.properties file for IDE use to enable stdout / > DEBUG; then having to remember to switch it back when doing > subversion commits etc. > > I'm sure somewhere there's a great log4j plugin to eclipse that > actually works well (I've tried a few plugins for IDEs over the years > and never managed to get them to work well); but as a quick hack I > created a new project called IDE which just contains stuff to put on > the classpath when running stuff in your IDE; so added a > log4j.properties for IDE use. Then I added this as the first > dependency in the ActiveMQ project and voila - no more hack-revert of > the log4j.properties in the maven build; I can keep the 2 separate. > > Totally trivial and obvious - and I'm sure some ecilpse plugin > somewhere solves this better - but its well worth doing something > like this if you hack on the ActiveMQ code a fair bit. > > James > ------- > http://radio.weblogs.com/0112098/ > > >