Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 11896 invoked from network); 1 Apr 2002 19:42:36 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Apr 2002 19:42:36 -0000 Received: (qmail 14981 invoked by uid 97); 1 Apr 2002 19:42:21 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 14939 invoked by uid 97); 1 Apr 2002 19:42:20 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 14917 invoked from network); 1 Apr 2002 19:42:19 -0000 Message-ID: <02e901c1d9b6$28a40e40$c12810ac@jny.com> From: "hemant" To: "Struts Users Mailing List" References: <000e01c1d66d$77eb8e70$c12810ac@jny.com> <3CA3494C.7090300@rededc.com.br> <003901c1d684$9fbebff0$c12810ac@jny.com> <3CA3605B.2060703@rededc.com.br> <00e301c1d68c$056dec20$c12810ac@jny.com> <02bc01c1d9a6$a6f3d240$c12810ac@jny.com> <3CA8A7B1.6050101@rededc.com.br> Subject: Re: Struts 1.1Beta and Log4J, "No appender" Issue Date: Mon, 1 Apr 2002 14:48:11 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Marcelo Thanks for your time, here is the servlet part of the web.xml you asked for.. Regards hemant ///////////////////////////////web.xml start ///////////////////////////////////////////// org.apache.struts.action.ActionServlet LOG4J_CONFIG /com/jny/operations/mplanning/mpi/properties/log4j.properties 1 action org.apache.struts.action.ActionServlet debug 2 config /WEB-INF/struts-config.xml application com.jny.operations.mplanning.mpi.properties.ApplicationResource s detail 2 validate true 1 /////...................... more web.xml details..... ////////////////////////////////web.xml end//////////////////////////////////////////// The following is my init method... ////////////////////////////////////init() start/////////////////////////////////////////////// public void init() { // insert code to initialize the servlet here // Testing Log4J............................... try { String configFile = getServletConfig().getInitParameter("LOG4J_CONFIG"); Logger logger = new Logger(configFile); } catch (Exception e) { System.out.println("The exception is " + e.toString()); } } ////////////////////////////////////init() end/////////////////////////////////////////////// //////////////////////////////////Logger class start//////////////////////////////////////////// public class Logger { static Category cat = Category.getInstance("mpi"); public Logger(String log4jpath) { try { if ((null != log4jpath) && (log4jpath.trim().length() > 0) ) { Properties pp = new Properties(); URL url = pp.getClass().getResource(log4jpath); PropertyConfigurator.configure(url); } else { BasicConfigurator.configure(); } } catch (Exception e) { System.err.println("Error in Configuration: " + e); } /////////////////////// // Lots of methods here for debug(), info(), etc for example... // public static void info(String message) // { // cat.info(message); // } ////////////////////// } } /////////////////////////////////Logger End///////////////////////////////////////////////////// ----- Original Message ----- From: "Marcelo Vanzin" To: "Struts Users Mailing List" Sent: Monday, April 01, 2002 1:32 PM Subject: Re: Struts 1.1Beta and Log4J, "No appender" Issue > > Could you post the part of your web.xml where the servlets are declared, > and the init() method of your StartupManager servlet, so I could take a > look at them? > > I have the same setup as you seem to have (a servlet loading the Log4j > configuration prior to the ActionServlet loading) and I never get this > error. > > hemant wrote: > > I tried to load my StartupManager Servlet which loads the Log4J > > configuration prior to ActionServlet load but in vain. > > > > I still get the following.. > > > > log4j: No appenders could be found for category > > (org.apache.commons.digester.Digester). > > log4j: Please initialize the log4j system properly > > > -- > []'s > Marcelo Vanzin > Touch Tecnologia > vanza@rededc.com.br > "Life is too short to drink cheap beer" > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: