Thanks Juha,

But if we remove log4j from WEB-INF\lib we can't separate the messages
from the different webapps, we just end up with one log file. Also we
don't get any further errors reported.

The Tomcat 6 docs talks about setting up common logging and then goes on
to say:

"Your web applications should certainly use their own log4j
configuration. This is valid with the above configuration. You would
place a similar log4j.properties file in your web application's
WEB-INF/classes folder, and log4j1.2.8.jar into WEB-INF/lib. Then
specify your package level logging. This is a basic setup of log4j which
does *not* require Commons-Logging"

So we aren't doing anything unusual.

Debugging the log4j we can see it loading all jars and all properties
files.

We have also noticed that although we get messages in the correct log
files they only seem to be from context listener classes and nothing
else.

Any other way to get separate log files for each webapp?

Mark



-----Original Message-----
From: Juha Laiho [mailto:[EMAIL PROTECTED] 
Sent: 16 July 2007 07:36
To: Tomcat Users List
Subject: Re: Log4j errors on Tomcat6 startup

Mark Faircloth wrote:
> We are in the process of migrating from 5.5 to 6 under Win32/64 and
need
> to alter the locations of some of our jars files because of the
changes
> to the directory structure and the class loading. 
> 
> Under 5.5 we have commons-logging.jar and log4j.jar in WEB-INF\lib and
> that works fine. For 6 we have put commons-logging and log4j.jar into
> \lib otherwise it fails on loading any context listeners. We also have
a
> copy of log4j.jar still in WEB-INF\lib for webapp specific logging
> pretty much as the documentation states.
> 
> This all runs okay and we get the output we would expect but on
start-up
> we get errors in the stdout log such as:
> 
> log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is
not
> assignable to a "org.apache.log4j.Appender" variable.
... [error detail describing that classes were loaded by separate
loaders]
> log4j:ERROR Could not instantiate appender named "MAIN".
> 
> Understandably considering we are class loading in two places. My
> question is, are these error messages really benign and can we get rid
> of them somehow or are we doing something wrong and need to
investigate
> further?

You have a problem here; at least some parts of Log4j are in inoprative
state (and you could get more error messages of the same kind later on).

You should fix this by fixing the classloading issue (which pretty much
means throwing the jar files out of WEB-INF\lib), unless you can revert
the classloading structure back to what it was in TC 5.5 - which seems
unlikely.
-- 
..Juha

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



Connaught wins RoSPA Gold Award for fifth year running 

Considerate Contractor Gold Award in 2006 

Partnering Contractor of the Year Award in 2005 

Please visit our website to see a full list of Connaught's Registered Companies 
www.connaught.plc.uk/Investors/Registered-Companies 
  
Disclaimer: 
The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential and/or privileged material. Any 
review, retransmission, dissemination or other use of, or taking of any action 
in reliance upon, this information by persons or entities other than the 
intended recipient is prohibited. If you received this in error, please contact 
the sender and delete this message. 
Connaught plc, Head Office 01392 444546 

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

Reply via email to