Tomcat 6.0.10 with log4j 1.2.14

C

christriddle

Hi,
I am trying to get the log4j logger to work with tomcat. I have used
the following log4j.properties file in the /common/classes directory:

log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${catalina.home}/logs/tomcat.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.org.apache.catalina=DEBUG, R

I also have log4j.jar in the lib directory, tomcat-juli.jar in the bin
(downloaded off the net, not built using the ant script - is this ok?)
and tomcat-juli-adapters.jar in the lib dir.

When I restart tomcat, it comes p with two warnings:
No appenders could be found for logger
(org.apache.catalina.startup.Embedded)
Please initilize the log4j system properly. - I find this particularly
helpfull!!

I'm not sure what's going on. I'm relatively new at all this, and the
documentation on the net is pretty trim.
Is there any suggestions?

Many thanks,
Chris
 
L

Lew

Hi,
I am trying to get the log4j logger to work with tomcat. I have used
multiposting.

Please do not multipost, that is, send the same message independently to
separate newsgroups. What happens is that people can't follow the
conversation as it is fragmented between the threads. Sometimes people get
quite exercised because they miss vital responses that were in a different
group; you can virtually hear the resentment as they complain that they were
following the conversation in one group, and that messages in a different
group really are in a different thread and they shouldn't be expected to
follow across multiple groups. At least one poster recently was very adamant
that they shouldn't be accountable for reading messages posted on a thread in
another group; actually he was rather snide about it. I'm not endorsing his
attitude, but it's indicative of how multi-posting does little to help you and
might repel those who could really help you. (The complainer in this instance
is a very knowledgeable Java developer and usually very enthusiastic about
providing information and his opinions.)

In the rare cases where you feel you absolutely /have/ to reach more than one
group, even though it's mostly the same people reading both groups, then
cross-post: include both groups in the destination at once rather than
separately sending your message. In that circumstance I recommend that you
set the "Followup" ("f/u") to just one of the groups.
 
J

Juha Laiho

I am trying to get the log4j logger to work with tomcat. I have used
the following log4j.properties file in the /common/classes directory:

If I see correctly (conf/catalina.properties), in TC 6.0.x the
common/classes directory is no longer part of the default common
classloader classpath. The classloader structure has been changed
quite a lot from TC 5.5.x to TC 6.0.x.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top