struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Azeem Niazi" <>
Subject Re: AW: using log4J with Struts
Date Fri, 30 Mar 2001 22:58:00 GMT
<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>
<DIV></DIV>&gt;Subject: AW: using log4J with Struts 
<DIV></DIV>&gt;Date: Sat, 31 Mar 2001 00:27:06 +0200 
<DIV></DIV>&gt;Hi Jon, 
<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
<DIV></DIV>&gt;After that the ActionServlet is called. 
<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
<DIV></DIV>&gt;I really wounldn´t start mixing the ActionServlet with anything
else but 
<DIV></DIV>&gt;Hope this helps. 
<DIV></DIV>&gt; -----Ursprüngliche Nachricht----- 
<DIV></DIV>&gt; Von: Jon Wilmoth [] 
<DIV></DIV>&gt; Gesendet: Freitag, 30. März 2001 23:56 
<DIV></DIV>&gt; An: 
<DIV></DIV>&gt; Betreff: Re: using log4J with Struts 
<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; Thanks, 
<DIV></DIV>&gt; Jon Wilmoth 
<DIV></DIV>&gt; ----- Original Message ----- 
<DIV></DIV>&gt; From: Tomer Meshorer 
<DIV></DIV>&gt; To: '' 
<DIV></DIV>&gt; Sent: Friday, March 30, 2001 11:28 AM 
<DIV></DIV>&gt; Subject: RE: using log4J with Struts 
<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; Tomer Meshorer 
<DIV></DIV>&gt; NewChannel 
<DIV></DIV>&gt; -----Original Message----- 
<DIV></DIV>&gt; From: Azeem Niazi [] 
<DIV></DIV>&gt; Sent: Friday, March 30, 2001 11:22 AM 
<DIV></DIV>&gt; To: 
<DIV></DIV>&gt; Subject: using log4J with Struts 
<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; Get your FREE download of MSN Explorer at

<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; &gt;&gt;

<DIV></DIV><br clear=all><hr>Get your FREE download of MSN Explorer
at <a href=""></a><br></p></html>

View raw message