Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 44695 invoked from network); 2 Jun 2010 08:07:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jun 2010 08:07:06 -0000 Received: (qmail 55631 invoked by uid 500); 2 Jun 2010 08:07:06 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 55503 invoked by uid 500); 2 Jun 2010 08:07:05 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 55483 invoked by uid 99); 2 Jun 2010 08:07:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 08:07:05 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chirunhua@gmail.com designates 209.85.212.54 as permitted sender) Received: from [209.85.212.54] (HELO mail-vw0-f54.google.com) (209.85.212.54) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 08:06:56 +0000 Received: by vws10 with SMTP id 10so4696048vws.13 for ; Wed, 02 Jun 2010 01:06:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=bhE1rXdAGmoD8WvIpFoU+mM6JwivS4cNY+IGtvAUMmw=; b=L2VBhYYLX3oMuBGqZtDBjWRY5Ct2gnzp9Uu8SvOWBS9CkQi+L9w1aahkVLcag9YLsz 0defghNBkHYDcNsRRuWGjTde+XZBYSx7opYipP4inSsHpGY9LAufYi/xOH7ERjrm73Z6 BaJAbCL2JoMcC+eGqIJw34WT3p0Fv+Ze7SwZY= 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; b=YcUTc7fNUekvAm8rnhGxR9tjMS5LzlVdZFoacVCGSIvsqkeuC65/btHVeiqaXPG4wQ cQR53+1yubt3/WteqsewmUui5IOVmiI+q1yG4a4+aSHnUlbsGUclZ5keCPOJopmhBcb3 GiRTOMnouc0qdhgc6z6X8R/q7/Yqq2bBaN2XE= MIME-Version: 1.0 Received: by 10.220.128.202 with SMTP id l10mr5401595vcs.263.1275465995713; Wed, 02 Jun 2010 01:06:35 -0700 (PDT) Received: by 10.220.128.198 with HTTP; Wed, 2 Jun 2010 01:06:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 2 Jun 2010 16:06:35 +0800 Message-ID: Subject: Re: Application specific log4j issue From: chi runhua To: dev@geronimo.apache.org Content-Type: multipart/alternative; boundary=e0cb4e887c4b98fc7904880791bf X-Virus-Checked: Checked by ClamAV on apache.org --e0cb4e887c4b98fc7904880791bf Content-Type: text/plain; charset=ISO-8859-1 log4j.appender.FILE.File=${catalina.home}/logs/logs.log is used to define where you log file is. Since you want application specific log configuration. You need to define different log4j.appender.FILE.file attributes in order to make sure application logs into its own log file.Then use ApplicationLog4jConfigurationGBean to define where your log4j.properties is. The problem that both the application goes into one log file, which was created last, might be caused that both your application use the same package name, such as com.ibm. Thus, the log4j instance will use the same key as og4j.logger.com.ibm=DEBUG,FILE. You can "hide" the parent log4j instance of Geronimo server by using element in your deployment plan. Accordingly, you should add the dependency of log4j as followed to initiate separate log4j instance for your application. log4j log4j log4j Hope this helps. Anything incorrect, please chime in. Jeff Chi On Tue, Jun 1, 2010 at 8:47 PM, Tannu Agarwal wrote: > Hi, > > We are using geronimo Version 2.1.4. We are facing issue when we configure > application specific log4j. We have two applications which get deployed on > Geronimo. When we start the application separate log files gets created for > both the application but all the logs for both the application goes into one > log file log (file which gets created last). In other words, all logs are > written as per the log4j configuration of the application that was deployed > most recently. > > Following is the log4j file which we are using in our application: > > *(See attached file: log4j.properties)* > > Please help. > > Thanks, > Tannu Agarwal > > --e0cb4e887c4b98fc7904880791bf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable log4j.appender.FILE.File=3D${catalina.home}/logs/logs.log is used to define= where you log file is. Since you want application specific log configurati= on. You need to define different log4j.appender.FILE.file attributes in ord= er to make sure application logs into its own log file.Then use=A0Applicati= onLog4jConfigurationGBean to define where your log4j.properties is.

The problem that both the application goes into one log file= , which was created last, might be caused that both your application use th= e same package name, such as com.ibm. Thus, the log4j instance will use the= same key as=A0og4j.logger.com.ibm=3DDEBUG,FILE. =A0You can "hide"= ; the parent log4j instance of Geronimo server by using <hidden-classes/= > element=A0in your deployment plan. Accordingly, you should add the dep= endency of log4j as followed to initiate separate log4j instance for your a= pplication.

<hidden-classes><filter>log4j&l= t;/filter></hidden-classes>

<dependencies>
=A0=A0 <dependency>
=A0=A0 =A0 =A0 =A0 =A0<groupId>log4j</groupId>
=A0= =A0 =A0 =A0 =A0 =A0<artifactId>log4j</artifactId>
=A0= =A0 =A0</dependency>
</dependencies>


Hop= e this helps. Anything incorrect, please chime in.

Jeff Chi



On Tue, Jun 1, 2010 at 8:47 PM, Tannu Agarwal <tagarwal@us.ibm.com> wrote:

Hi,

We are using geronimo Version 2.1.4. W= e are facing issue when we configure application specific log4j. We have tw= o applications which get deployed on Geronimo. When we start the applicatio= n separate log files gets created for both the application but all the logs= for both the application goes into one log file log (file which gets creat= ed last). In other words, all logs are written as per the log4j configurati= on of the application that was deployed most recently.

Following is the log4j file which we a= re using in our application:

(See attached file: log4j.properties)

Please help.

Thanks,
Tannu Agarwal


--e0cb4e887c4b98fc7904880791bf--