Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 13267 invoked from network); 9 Apr 2009 04:57:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Apr 2009 04:57:41 -0000 Received: (qmail 78281 invoked by uid 500); 9 Apr 2009 04:57:40 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 78227 invoked by uid 500); 9 Apr 2009 04:57:40 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 78219 invoked by uid 99); 9 Apr 2009 04:57:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2009 04:57:40 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xhhsld@gmail.com designates 209.85.221.127 as permitted sender) Received: from [209.85.221.127] (HELO mail-qy0-f127.google.com) (209.85.221.127) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2009 04:57:34 +0000 Received: by qyk33 with SMTP id 33so1233919qyk.27 for ; Wed, 08 Apr 2009 21:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=vBJ5MOtlF+NDyh41kjikHyvTFYe1RZ/V2V3AQvEgIfM=; b=qoqbIWsR6FWbOruvkelRsOiXDSKLvbm9zdEcLqM0VNojOIdOOM46efIkxmkBQ3GRsU XIWDS/0i6vwr19yC+p/Xg/lhPqnse0I+zJxBIvzWCv9SwMzxmIkGP8doIaY7pgduFC5K WsNUP2ibEP7/rgAsNTGFWvTAJerjmfP4/AAW0= 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=PIsCQrDfLVI+tpX62UqY8rSLnMV/ifLaDDz42gcP81B8AcouEb1xOOAqTr96E5axBK H8ncxYCgteciCxnyYyO9f7/NjfK4VFhoJmgVQMh3KdeWOMdBOZR0Z+4vmb/yeYzFM3gi CqrqrMNDqGlru1HoYbQ1wQXfQeoZH6rF3oa3E= MIME-Version: 1.0 Received: by 10.229.82.79 with SMTP id a15mr792337qcl.57.1239253033071; Wed, 08 Apr 2009 21:57:13 -0700 (PDT) In-Reply-To: <45f744e40904082151s1ad44b6cs3ed9cc437193eef2@mail.gmail.com> References: <1103346364@web.de> <45f744e40904082151s1ad44b6cs3ed9cc437193eef2@mail.gmail.com> Date: Thu, 9 Apr 2009 12:57:13 +0800 Message-ID: <45f744e40904082157m67a75cf8g9d0e45bf549920b7@mail.gmail.com> Subject: Re: Problems using log4j Gbean From: Ivan To: user@geronimo.apache.org Content-Type: multipart/alternative; boundary=00163646d542d2bd2604671814d3 X-Virus-Checked: Checked by ClamAV on apache.org --00163646d542d2bd2604671814d3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Another way without chaning anything is, 1. Put something like below in your deployment plan log4j log4j jar org.slf4j slf4j-api jar org.slf4j slf4j-log4j12 jar org.apache.log4j org.slf4j 2. Do NOT use the ApplicationLog4jConfigurationGBean gbean, just put a log4j.properties in your application's classpath, let log4j itself to manag= e the configurations. It should work as expected. Ivan 2009/4/9 Ivan > Yes, it needs to be improved. > I opened a JIRA in https://issues.apache.org/jira/browse/GERONIMO-4615. > If you could like to, you could apply the patch to the code repo which is > used. Build the geronimo-system module, and paste it to the lib folder an= d > repository folder. > Also, you need to add something to your deployment plan. Then ... > Thanks ! > Ivan > > > 2009/4/8 Jochen Zink > > The util part, has the same package name, because the classes are located >> inside a util.jar, which is used by both applications and placed in >> WEB-INF/lib of both applications. The Applications itself have different >> package names. >> >> But it is also imaginable, that the applications have the same package >> names. Application A can deployed twice, if the module ID and context-ro= ot >> in geronimo-web.xml is different. It would be nice feature, if it is >> possible to log in different Logfiles, in this situation. >> >> Regards >> Jochen >> >> > -----Urspr=FCngliche Nachricht----- >> > Von: "Ivan" >> > Gesendet: 07.04.09 16:01:48 >> > An: user@geronimo.apache.org >> > Betreff: Re: Problems using log4j Gbean >> >> Are the application A has the same package names with the package B ? >> > I mean >> > In the properties File for application A : >> > log4j.logger.de.test.webapp.util=3DDEBUG,fileA >> > >> > In the properties File for application B : >> > log4j.logger.de.test.webappB.util=3DDEBUG,fileB >> > >> > IIRC, they should not the same, for Log4j share a global configuration= . >> > >> > Ivan >> > >> > 2009/4/7 Jochen Zink >> > Hello, >> > >> > we use geronimo 2.1.1. For Logging, we use Log4j and the log4j Plugin. >> > >> > We have two Webapplications (WebApp A and WebApp B) running. Both use >> > a "util.jar". >> > >> > If we deployApplication A before application B, Application A logs >> > into Application Bs logfile. If we deploy first application B, >> > application B logs into application As logfile. >> > >> > I guess, this is related to the equal package name from util.jar. >> > >> > Is there a possibility to avoid this? >> > >> > Here is geronimo-web.xml (plugin part) for application A. Application >> > Bs is equal. Only the properties name is different. >> > > > system.logging.log4j.ApplicationLog4jConfigurationGBean"> >> > var/log/applicationA.properties> > attribute> >> > >> > ServerInfo >> > >> > >> > >> > And here is the content of the log4j properties File for application >> > A. This is equal to application Bs properties. Only fileA changed to >> > fileB and so on. >> > >> > log4j.appender.fileA=3Dorg.apache.log4j.DailyRollingFileAppender >> > log4j.appender.fileA.threshold=3DDEBUG >> > log4j.appender.fileA.file=3D${org.apache.geronimo.server.dir}/var/log/ >> > appA.log >> > log4j.appender.fileA.layout=3Dorg.apache.log4j.PatternLayout >> > log4j.appender.fileA.layout.ConversionPattern=3DApplication A: %d{dd.M= M. >> > yyyy, HH:mm:ss} %p (%c:%L) %m%n >> > >> > log4j.logger.de.test.webapp.util=3DDEBUG,fileA >> > log4j.logger.de.test.webapplicationA=3DDEBUG,fileA >> > log4j.additivity.de.webapp.util=3Dfalse >> > log4j.additivity.de.webapplicationA=3Dfalse >> > >> > Thanks a lot! >> > Regards >> > Jochen >> > >> > ____________________________________________________________________ >> > Psssst! Schon vom neuen WEB.DE MultiMessenger geh=F6rt? >> > Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3D3123 >> > >> > -- >> > Ivan >> > >> > >> >> >> ____________________________________________________________________ >> Psssst! Schon vom neuen WEB.DE MultiMessenger geh=F6rt? >> Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3D3123 >> >> > > > -- > Ivan > --=20 Ivan --00163646d542d2bd2604671814d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Another way without chaning anything is,
1. Put=A0 something like below= in your deployment plan
=A0=A0 <dep:dependencies>
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 <dep:dependency>
=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 <dep:groupId>log4j</dep:groupId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:artifactId>log4j&l= t;/dep:artifactId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <= dep:type>jar</dep:type>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </= dep:dependency>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:dependency&= gt;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:groupId>org= .slf4j</dep:groupId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:artifactId>slf4j-a= pi</dep:artifactId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 = <dep:type>jar</dep:type>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 &= lt;/dep:dependency>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:depende= ncy>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:groupId>= ;org.slf4j</dep:groupId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:artifactId>slf4j-l= og4j12</dep:artifactId>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 <dep:type>jar</dep:type>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 </dep:dependency>
=A0=A0=A0=A0=A0=A0=A0 </dep:dependencies&= gt;
=A0=A0=A0=A0=A0=A0=A0 <dep:hidden-classes>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:filter>org.apache.log4j</de= p:filter>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <dep:filter>org.slf= 4j</dep:filter>
=A0=A0=A0=A0=A0=A0=A0 </dep:hidden-classes><= br>2. Do NOT use the ApplicationLog4jConfigurationGBean gbean, just put a l= og4j.properties in your application's classpath, let log4j itself to ma= nage the configurations.

It should work as expected.
=A0=A0=A0=A0 Ivan


2009/4/9 Ivan <xhhsld@gmail.com>
Yes, it needs to be improved.
I opened a JIRA in https://issues.a= pache.org/jira/browse/GERONIMO-4615.
If you could like to, you could= apply the patch to the code repo which is used. Build the geronimo-system = module, and paste it to the lib folder and repository folder.
Also, you need to add something to your deployment plan. Then ...
Thanks= !
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Ivan


2009/4/8 Jochen Zink <jochenlist@web.de>

The util part, ha= s the same package name, because the classes are located inside a util.jar,= which is used by both applications and placed in WEB-INF/lib of both appli= cations. The Applications itself have different package names.

But it is also imaginable, that the applications have the same package name= s. Application A can deployed twice, if the module ID and context-root in g= eronimo-web.xml is different. It would be nice feature, if it is possible t= o log in different Logfiles, in this situation.

Regards
Jochen

> -----Urspr=FCngliche Nachricht-----
> Von: "Ivan" <xhhsld@gmail.com>
> Gesendet: 07.04.09 16:01:48
> An: user= @geronimo.apache.org
> Betreff: Re: Problems using log4j Gbean

Are the application A has the same package names with the package B ?
> I mean
> In the properties File for application A :
> log4j.logger.de.test.webapp.util=3DDEBUG,fileA
>
> In the properties File for application B :
> log4j.logger.de.test.webappB.util=3DDEBUG,fileB
>
> IIRC, they should not the same, for Log4j share a global configuration= .
>
> =A0Ivan
>
> 2009/4/7 Jochen Zink <jochenlist@web.de>
> Hello,
>
> we use geronimo 2.1.1. For Logging, we use Log4j and the log4j Plugin.=
>
> We have two Webapplications (WebApp A and WebApp B) running. Both use<= br> > a "util.jar".
>
> If we deployApplication A before application B, Application A logs
> into Application Bs logfile. If we deploy first application B,
> application B logs into application As logfile.
>
> I guess, this is related to the equal package name from util.jar.
>
> Is there a possibility to avoid this?
>
> Here is geronimo-web.xml (plugin part) for application A. Application<= br> > Bs is equal. Only the properties name is different.
> <gbean name=3D"DirectoryLog4jConfiguration" class=3D"= ;org.apache.geronimo.
> system.logging.log4j.ApplicationLog4jConfigurationGBean">
> =A0<attribute name=3D"log4jFile">var/log/applicationA.= properties</
> attribute>
> =A0<reference name=3D"ServerInfo">
> =A0<name>ServerInfo</name>
> =A0</reference>
> =A0</gbean>
>
> And here is the content of the log4j properties File for application > A. This is equal to application Bs properties. Only fileA changed to > fileB and so on.
>
> log4j.appender.fileA=3Dorg.apache.log4j.DailyRollingFileAppender
> log4j.appender.fileA.threshold=3DDEBUG
> log4j.appender.fileA.file=3D${org.apache.geronimo.server.dir}/var/log/=
> appA.log
> log4j.appender.fileA.layout=3Dorg.apache.log4j.PatternLayout
> log4j.appender.fileA.layout.ConversionPattern=3DApplication A: %d{dd.M= M.
> yyyy, HH:mm:ss} %p (%c:%L) %m%n
>
> log4j.logger.de.test.webapp.util=3DDEBUG,fileA
> log4j.logger.de.test.webapplicationA=3DDEBUG,fileA
> log4j.additivity.de.webapp.util=3Dfalse
> log4j.additivity.de.webapplicationA=3Dfalse
>
> Thanks a lot!
> Regards
> Jochen
>
> ____________________________________________________________________ > Psssst! Schon vom neuen WE= B.DE MultiMessenger geh=F6rt?
> Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3D= 3123
>
> --
> Ivan
>
>


____________________________________________________________________
Psssst! Schon vom neuen WEB.DE<= /a> MultiMessenger geh=F6rt?
Der kann`s mit allen:
http://www.produkte.web.de/messenger/?did=3D3123=




-- Ivan



--
Ivan
--00163646d542d2bd2604671814d3--