struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hemant" <xr...@yahoo.com>
Subject Re: Struts 1.1Beta and Log4J, "No appender" Issue
Date Mon, 01 Apr 2002 17:57:11 GMT
Fellow Loggers,

The problem still recurs.
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

The above error seems to be simple to handle but there is an internal
mechanism that is trying to discover Log4J and is doing something with it
even before I load Log4J (via StartupManager Servlet) myself. If all I need
to do is to add an appender, which properties file is it looking for? and
where is it looking for? (/classes)??. It definitely is not looking at my
log4j.properties as I tried to add the appender there and it did not work.

Another question, slightly on a tangent though, I get a "Cannot find
ActionMappings or ActionFormBeans collection" while the same
struts-config.xml works fine with Struts 1.0.2

Please Advise
hemant








----- Original Message -----
From: "hemant" <xraiz@yahoo.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, March 28, 2002 2:09 PM
Subject: Re: Struts 1.1Beta and Log4J, "No appender" Issue


> Marcelo
>
> Thanks, Will try to make sure that Log4J initializes prior to
ActionServlet
> load. Earlier, I had a Logger class which had a Category instance
> initialized in a static block. Looks like my Logger was loaded prior to
> ActionServlet with 1.0.2. Now, I guess I have to write a startup servlet
and
> load it prior to ActionServlet as you said.
>
> have a good weekend
> hemant
>
>
> public class Logger
> {
>         static Category category = Category.getInstance("mpi");
>     static {
>         try
>             {
>
>             String pc = CommonConstants.LOG4JPATH;
>             System.out.println("pc is " + pc);
>             if ((pc.trim().length() > 0) && (null != pc))
>                 {
>                 Properties pp = new Properties();
>                 URL url = pp.getClass().getResource(pc);
>                 PropertyConfigurator.configure(url);
>             }
>             else
>                 {
>                 BasicConfigurator.configure();
>             }
>         }
>         catch (Exception e)
>             {
>             System.err.println("Error in Configuration: " + e);
>         }
>     }
>
> ///////////////////////
> // Lots of methods here for debug(), info(), etc
> //////////////////////
>
> }
>
>
>
>
> -----------------------------------------------------------
>
> > hemant wrote:
> > > The Log4J configuration loaded property when I used Struts 1.0.2. If
it
> > > worked then, shouldn't it work now with struts 1.1beta?
> >
> > It worked with 1.0.2, but Struts did not use the commons-logging package
> > then, so the log messages weren't printed through Log4j, which is the
> > case now.
> >
> > It seems that you initialize the log4j configuration after the Struts'
> > ActionServlet loads, so when the ActionServlet (and the Digester, and
> > Beanutils, etc) try to log and log4j is not yet configured, you get that
> > error.
> >
> > I have a servlet that loads some configuration for my application. I've
> > set it up so that it loads before the Struts' ActionServlet, so that the
> > log4j system is properly initialized when called. Try do do something
> > similar.
> >
> > --
> > []'s
> > Marcelo Vanzin
> > Touch Tecnologia
> > vanza@rededc.com.br
> > "Life is too short to drink cheap beer"
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message