Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2007

Tip: Looking for answers? Try searching our database.

Tomcat 6.0.10 with log4j 1.2.14

Thread view: 
christriddle@googlemail.com - 15 Aug 2007 10:33 GMT
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
Lew - 15 Aug 2007 13:23 GMT
> 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.

Signature

Lew

Juha Laiho - 19 Aug 2007 12:32 GMT
"christriddle@googlemail.com" <christriddle@googlemail.com> said:
>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.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.