struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Azeem Niazi" <akha...@hotmail.com>
Subject Re: AW: using log4J with Struts
Date Fri, 30 Mar 2001 22:58:00 GMT
<html><DIV>
<P>Rainer</P>
<P>You forgot to attach the routines and log4 J config file. I am new to both Struts
and Log4j.So what it is coming down to is you define init params in one of the routines you
are talking here and then reference them in web.xml, so it gets registered with controller
servlet. Could you send a sample of web.xml with log4J categories registered in it along with
some init routines.</P>
<P>What would be the best way of passing config file for log4J to PropertyConfigurator(config),
in cases where you are developing your application in one environment and then want to move
your application transparently to a differently env without affecting passing of config file
location(e.g moving from Windows to Unix)&nbsp;<BR><BR>Thanks</P>
<P>Azeem</P></DIV>
<DIV></DIV>
<DIV></DIV>&gt;From: Rainer Alföldi <ALFOELDI@KLUG-KOMMUNIKATION.DE>
<DIV></DIV>&gt;Reply-To: struts-user@jakarta.apache.org 
<DIV></DIV>&gt;To: <STRUTS-USER@JAKARTA.APACHE.ORG>, "Jon Wilmoth" <JWILMOTH@JPS.NET>
<DIV></DIV>&gt;Subject: AW: using log4J with Struts 
<DIV></DIV>&gt;Date: Sat, 31 Mar 2001 00:27:06 +0200 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Hi Jon, 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;we set up a startup servlet, that initializes our application.
This is very 
<DIV></DIV>&gt;simple and basically just calls various init routines. (No
subclassing) 
<DIV></DIV>&gt;After that the ActionServlet is called. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;All applications use init.props to get up and running. The
same with log4j. 
<DIV></DIV>&gt;I have attached the routines for startup as well as the configuration
for 
<DIV></DIV>&gt;log4j. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;I really wounldn´t start mixing the ActionServlet with anything
else but 
<DIV></DIV>&gt;Struts. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Hope this helps. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Greeting 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Rainer 
<DIV></DIV>&gt; -----Ursprüngliche Nachricht----- 
<DIV></DIV>&gt; Von: Jon Wilmoth [mailto:jwilmoth@jps.net] 
<DIV></DIV>&gt; Gesendet: Freitag, 30. März 2001 23:56 
<DIV></DIV>&gt; An: struts-user@jakarta.apache.org 
<DIV></DIV>&gt; Betreff: Re: using log4J with Struts 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; So your suggesting subclassing the default controller, 
<DIV></DIV>&gt;org.apache.struts.action.ActionServlet, to override only the
init method? 
<DIV></DIV>&gt;Also, I'm not familiar enough with the web.xml format as to
be able to 
<DIV></DIV>&gt;configure the org.apache.log4j.PropertyConfigurator. How would
one do this? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; Thanks, 
<DIV></DIV>&gt; Jon Wilmoth 
<DIV></DIV>&gt; ----- Original Message ----- 
<DIV></DIV>&gt; From: Tomer Meshorer 
<DIV></DIV>&gt; To: 'struts-user@jakarta.apache.org' 
<DIV></DIV>&gt; Sent: Friday, March 30, 2001 11:28 AM 
<DIV></DIV>&gt; Subject: RE: using log4J with Struts 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; Yes, In the init() method of the controller servlet define
all your 
<DIV></DIV>&gt;categories and give them a priority. You may also want to put
the categris 
<DIV></DIV>&gt;in web.xml so you can read them in runtime and thus be able
to change the 
<DIV></DIV>&gt;log detail level (i.e. only ERROR log messages) when you are
in production. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; Tomer Meshorer 
<DIV></DIV>&gt; NewChannel 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; -----Original Message----- 
<DIV></DIV>&gt; From: Azeem Niazi [mailto:akhanni@hotmail.com] 
<DIV></DIV>&gt; Sent: Friday, March 30, 2001 11:22 AM 
<DIV></DIV>&gt; To: struts-user@jakarta.apache.org 
<DIV></DIV>&gt; Subject: using log4J with Struts 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; Has anyone used log4J with struts. If so, how did you do it.
Do you 
<DIV></DIV>&gt;need to register log4j with controller servlet? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;--------------------------------------------------------------------------

<DIV></DIV>&gt; Get your FREE download of MSN Explorer at http://explorer.msn.com

<DIV></DIV>&gt; 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;&lt;&lt; init-mailinglist.conf &gt;&gt; 
<DIV></DIV>&gt;&lt;&lt; log-config-mailinglist.xml &gt;&gt;

<DIV></DIV>&gt;&lt;&lt; Startup-mailinglist.java &gt;&gt;

<DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer
at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>

Mime
View raw message