geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Ruggles <a.rugg...@gmail.com>
Subject Re: Geronimo 2/Log4j question
Date Thu, 06 Mar 2008 17:22:24 GMT

I used Spring to create the listener like you've described here.  It works,
but the only problem is that I have multiple web apps and I'd like them to
maintain their own log, however using this method causes the last web app to
load to take over the logging.



Łukasz Budnik wrote:
> 
> Hi!
> 
> I had the very same problem with G2.0.0, currently I'm using G2.1 and
> to tell the truth I don't know whether this issue still exists because
> I use a very simple work around that works always and for my case is
> sufficient.
> 
> Simply in WAR create a new class, implement the ServletContextListener
> interface and override contextInitialized method like this:
> 
> public void contextInitialized(ServletContextEvent ctx) {
> 		String prefix = ctx.getServletContext().getRealPath("/");
> 		String file =
> ctx.getServletContext().getInitParameter("log4j-configuration-file");
> 		if (file != null) {
> 			DOMConfigurator.configure(prefix + "WEB-INF/" + file);
> 		}
> 	}
> 
> it works in G2.0.0 and G2.1
> 
> If You manage to use Log4j without this workaround, let me know please ;)
> 
> best regards
> Łukasz
> 
> On 27/02/2008, Jacek Laskowski <jacek@laskowski.net.pl> wrote:
>> On Tue, Feb 5, 2008 at 11:10 AM, Adam Ruggles <a.ruggles@gmail.com>
>> wrote:
>>  >
>>  >  I am also having this issue.  In tomcat I just needed a log4j.xml in
>> my
>>  >  classpath, however geronimo seems to ignore it.
>>  >
>>  >  The only solution I've found is to have Spring configure log4j
>> through the
>>  >  web.xml but that takes over all logging in geronimo.  I need to have
>>  >  separate logging for each of my web apps.
>>
>>  Have you tried to inverse-classloading and/or hidden-classes elements
>>  in your plan so log4j and its configuration in Geronimo is for
>>  Geronimo stuff and yours is for your stuff?
>>
>>  Jacek
>>
>>
>>  --
>>  Jacek Laskowski
>>  http://www.JacekLaskowski.pl
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Geronimo-2-Log4j-question-tp12865061s134p15879047.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message