You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Konstantin Kolinko <kn...@gmail.com> on 2008/02/03 18:06:46 UTC

Re: misconfigured log4j issue

>
> Yes.  I manage the log4j configuration myself when my webapp loads -
> from a props file - I'm not using any of log4j's auto configure /
> discovery stuff.
>

Tomcat uses commons-logging for its logging needs. Apache commons
logging does decide what logging implementation to use at the time
when a class is loaded. If log4j is reachable through the current
thread classloader, it will be used. And the first time log4j is
accessed, it configures itself. In this case it searches for
log4j.properties or log4j.xml in your app's classes folder or
somewhere else from where classes are loaded.


> I configure log4j before I use it.  But, maybe its possible that since
> my webapp is providing log4j, tomcat is trying to use log4j for
> something in my webapp before I have it configured?
>

Yes. You may want to dig into commons logging for more details.

> Maybe I need to put some sort of junk log4j config file in my
> classpath to make log4j toss out any messages that occur before my
> code had a chance to configure log4j, if this is the case.
>

May be. I do not have experience of reconfiguring log4j on the fly.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: misconfigured log4j issue

Posted by Dan Armbrust <da...@gmail.com>.
I need to correct this point:


>
> Now, I think that is happening because struts is using
> commons-digester to read its xml config files, and commons-digester
> includes log4j logging.
>

commons-digester actually uses commons-logging, not log4j.

So, what can I do to find out more how the digester - commons-logging
connection is getting configured?

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Silent Install with Tomcat 5.5

Posted by David Brown <da...@davidwbrown.name>.
Have you tried installing standalone?

James.Chan@sungard.com wrote ..
> Hi All,
> 
> I'm looking for help on installing Tomcat 5.5 silently. I've used the /S
> option but the install seems to fail. The NT service doesn't even get
> installed! Does anyone have a proper solution to this problem? Is there
> a fix for this? Thanks.
> 
> James Chan * Software Developer * SunGard * BancWare ERisk * 825 Third
> Avenue, 27th floor * New York, NY 10022 Tel 917.522.1612 * Fax
> 212.515.3690* http://www.sungard.com/bancware
> 
> ________________________________________________________________________
> _________________
> 
> P Think before you print CONFIDENTIALITY: This e-mail (including any
> attachments) may contain confidential, proprietary and privileged
> information, and unauthorized disclosure or use is prohibited. If you
> received this e-mail in error, please notify the sender and delete this
> e-mail from your system.
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Silent Install with Tomcat 5.5

Posted by Ja...@sungard.com.
Hi All,

I'm looking for help on installing Tomcat 5.5 silently. I've used the /S
option but the install seems to fail. The NT service doesn't even get
installed! Does anyone have a proper solution to this problem? Is there
a fix for this? Thanks.

James Chan * Software Developer * SunGard * BancWare ERisk * 825 Third
Avenue, 27th floor * New York, NY 10022 Tel 917.522.1612 * Fax
212.515.3690* http://www.sungard.com/bancware

________________________________________________________________________
_________________

P Think before you print CONFIDENTIALITY: This e-mail (including any
attachments) may contain confidential, proprietary and privileged
information, and unauthorized disclosure or use is prohibited. If you
received this e-mail in error, please notify the sender and delete this
e-mail from your system.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: misconfigured log4j issue

Posted by Dan Armbrust <da...@gmail.com>.
Allright, the deeper I dig, the more confused I get.

I think there is a bug here, bug I still can't pinpoint how it happens.

Let's say I'm deploying 2 web applications - both use struts, and
therefor have dependencies on commons-digester.

App A starts up.  A includes a log4j jar file.  As A starts, it
configures log4j via code within the webapp.  There are no default
log4j config files supplied.

A configures log4j correctly, and there are no extraneous warnings.
At this point, from A, I can write a message to the logger
"org.apache.commons.digester.Digester.sax" and it will be written to
the proper appenders.

Now, tomcat launches webapp B.  Immediately, I get this warning on the
console before any of my init code gets a chance to run:
log4j:WARN No appenders could be found for logger
(org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.

Now, I think that is happening because struts is using
commons-digester to read its xml config files, and commons-digester
includes log4j logging.

But, why don't I get an error when app A starts?

Why does app B only print the warning if app A is started before it?
How can two different webapps be impacting each other like this?

I have tried putting log4j.properties file into all of the various
tomcat global classes directories.  It has no effect.

Running with "-Dlog4j.debug" shows me that when app A initializes,
log4j looks for the default config files.
However, when app B initializes, log4j does NOT look for the default
config files.  I'm not sure why this is happening - why should log4j
from app A impact how log4j behaves in app B?

Thanks,

Dan

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org