AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

logging setup problem with tomcat5.5.7 .... need help please

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.setup
View previous topic :: View next topic  
Author Message
jim shirreffs
Guest





PostPosted: Fri Nov 11, 2005 11:11 pm    Post subject: logging setup problem with tomcat5.5.7 .... need help please Reply with quote



I have tried just about everything to get logging working in tomcat5.5.7.
Can anyone tell me how to get container level logging working? I keep
getting this error
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.ClassLoaderFactory). log4j:WARN Please
initialize the log4j system properly.

This problem is happening on two diferent tomcat installs, I have been to
Apacte site and done everything thier docs say to do. And still logging does
not work.

thanks js
Back to top
Juha Laiho
Guest





PostPosted: Sat Nov 12, 2005 7:33 pm    Post subject: Re: logging setup problem with tomcat5.5.7 .... need help pl Reply with quote



"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:
Quote:
I have tried just about everything to get logging working in tomcat5.5.7.
Can anyone tell me how to get container level logging working? I keep
getting this error
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.ClassLoaderFactory). log4j:WARN Please
initialize the log4j system properly.

This problem is happening on two diferent tomcat installs, I have been to
Apacte site and done everything thier docs say to do. And still logging does
not work.

Let's gather some data.

Tomcat in itself doesn't contain log4j, so you've placed a log4j
library somewhere, and are apparently also using it somewhere.
If you're using it, you're hopefully also configuring it - how else
could anything be logged, because log4j wouldn't know where to write.

Where exactly did you drop the log4j library? This is important in the
sense that Tomcat used Jakarta commons-logging for its internal logging,
and commons-logging in turn will by default use log4j whenever it is
available. So just throwing a log4j library into a Tomcat installation
has good probability of messing up Tomcat internal logging.

What configuration method are you using for log4j? Is log4j picking
up the configuration? Start Tomcat with -Dlog4j.debug=true in
JAVA_OPTS to find out.

It is also possible to force commons-logging to use a specific logging
backend (note though that if any of your applications run within the
same Tomcat instance use commons-logging, this setting will also affect
those applications). To force commons-logging to not use log4j as
the backend, add
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
to JAVA_OPTS in tomcat startup and restart Tomcat.
--
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)
Back to top
jim shirreffs
Guest





PostPosted: Sun Nov 13, 2005 2:41 am    Post subject: Re: logging setup problem with tomcat5.5.7 .... need help pl Reply with quote



"Juha Laiho" <Juha.Laiho (AT) iki (DOT) fi> wrote in message
news:dl5g2p$u4$1 (AT) ichaos (DOT) ichaos-int...
Quote:
"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:
I have tried just about everything to get logging working in tomcat5.5.7.
Can anyone tell me how to get container level logging working? I keep
getting this error
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.ClassLoaderFactory). log4j:WARN Please
initialize the log4j system properly.

This problem is happening on two diferent tomcat installs, I have been to
Apacte site and done everything thier docs say to do. And still logging
does
not work.

Let's gather some data.

Tomcat in itself doesn't contain log4j, so you've placed a log4j
library somewhere, and are apparently also using it somewhere.
If you're using it, you're hopefully also configuring it - how else
could anything be logged, because log4j wouldn't know where to write.

Where exactly did you drop the log4j library? This is important in the
sense that Tomcat used Jakarta commons-logging for its internal logging,
and commons-logging in turn will by default use log4j whenever it is
available. So just throwing a log4j library into a Tomcat installation
has good probability of messing up Tomcat internal logging.

What configuration method are you using for log4j? Is log4j picking
up the configuration? Start Tomcat with -Dlog4j.debug=true in
JAVA_OPTS to find out.

It is also possible to force commons-logging to use a specific logging
backend (note though that if any of your applications run within the
same Tomcat instance use commons-logging, this setting will also affect
those applications). To force commons-logging to not use log4j as
the backend, add
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
to JAVA_OPTS in tomcat startup and restart Tomcat.
--
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)

I have removed all log4j.jars except the jar in jre/lib/ext, and
Tomcat/common/lib, my Tomcat will not start without the
jre/lib/ext/log4j.jar which I find curious since common/lib is where I
thougt all Tomcat required jars should go. I have also removed all the
log4j.properties files I could find.

My thinking is that Tomcat will default to it's own logging mechanism if
nothing else is available (used to work that way).

Other then server.xml I do not touch Tomcat configuration files. So I
basicly install, modify the server.xml and then run. I also do not use a
classpath when running Tomcat, so the only thing Tomcat should see the
jre/lib/ext and it's own stuff. I did manage to get Tomcat to at least
create log files on one computer (reinstalled everything) but it never
writes to them, the other computer does not even create the log files.

This problem is really hurting me as I am trying to develope a
axis/hibernate application but I can't debug without Tomcat logs. I've used
Tomcat for years and years without any problems.

What I probably need is a boiler plate lo4j.properties file for Tomcat that
I can put into common/classes , but the install does not contain one. I've
tried the following as a log4j.properties file but without success.

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Thank you for your interest.

jim s
Back to top
Juha Laiho
Guest





PostPosted: Sun Nov 13, 2005 12:05 pm    Post subject: Re: logging setup problem with tomcat5.5.7 .... need help pl Reply with quote

"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:
Quote:

"Juha Laiho" <Juha.Laiho (AT) iki (DOT) fi> wrote in message
news:dl5g2p$u4$1 (AT) ichaos (DOT) ichaos-int...
"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:
I have tried just about everything to get logging working in tomcat5.5.7.
Can anyone tell me how to get container level logging working? I keep
getting this error
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.ClassLoaderFactory). log4j:WARN Please
initialize the log4j system properly.

This problem is happening on two diferent tomcat installs, I have been to
Apacte site and done everything thier docs say to do. And still logging
does not work.

Let's gather some data.

Tomcat in itself doesn't contain log4j, so you've placed a log4j
library somewhere, and are apparently also using it somewhere.
If you're using it, you're hopefully also configuring it - how else
could anything be logged, because log4j wouldn't know where to write.

Where exactly did you drop the log4j library? This is important in the
sense that Tomcat used Jakarta commons-logging for its internal logging,
and commons-logging in turn will by default use log4j whenever it is
available. So just throwing a log4j library into a Tomcat installation
has good probability of messing up Tomcat internal logging.

What configuration method are you using for log4j? Is log4j picking
up the configuration? Start Tomcat with -Dlog4j.debug=true in
JAVA_OPTS to find out.

It is also possible to force commons-logging to use a specific logging
backend (note though that if any of your applications run within the
same Tomcat instance use commons-logging, this setting will also affect
those applications). To force commons-logging to not use log4j as
the backend, add
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
to JAVA_OPTS in tomcat startup and restart Tomcat.

I have removed all log4j.jars except the jar in jre/lib/ext, and
Tomcat/common/lib, my Tomcat will not start without the
jre/lib/ext/log4j.jar which I find curious since common/lib is where I
thougt all Tomcat required jars should go. I have also removed all the
log4j.properties files I could find.

jre/lib/ext is at least part of the bootstrap classpath, and I think it
could make its way to some other Tomcat classpaths as well. But now,
what in your setup does require log4j, as plain Tomcat works without
log4j just fine?

Quote:
My thinking is that Tomcat will default to it's own logging mechanism if
nothing else is available (used to work that way).

The logging mechanism used by Tomcat is Jakarta commons-logging
package, and by default it will use either log4j, the JDK 1.4 logging
subsystem, or its internal simple logger (in this order, as support
classes are found). But as I wrote earlier, this can be overridden with
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
in JAVA_OPTS at tomcat startup. Could you see if this helps you?

Quote:
Other then server.xml I do not touch Tomcat configuration files. So I
basicly install, modify the server.xml and then run. I also do not use a
classpath when running Tomcat, so the only thing Tomcat should see the
jre/lib/ext and it's own stuff. I did manage to get Tomcat to at least
create log files on one computer (reinstalled everything) but it never
writes to them, the other computer does not even create the log files.

Well, log4j doesn't end in jre/lib/ext by itself, so someone did place
it there. Looks like you should go back to a very clean situation and
trace forward step by step from there, to find out which of your
installs do what behind the scenes. You clearly are not in control of
the situation any more. Stop chaos, take control. Then start building
gain, step by step - and paying attention to what all happens. Then,
if something unexpected happens, you can backtrack just a single step,
instead of redo-all.

Quote:
What I probably need is a boiler plate lo4j.properties file for Tomcat that
I can put into common/classes , but the install does not contain one. I've
tried the following as a log4j.properties file but without success.

Don't stagger in the darkness. Find a place where you know which
pieces are affecting the play - and control the playground yourself.
So, don't just place things all over by random guesses - looks
like that's how you ended in your current situation in the first
place.

So, things to determine:
- what in your system requires log4j; is it an essential part of
your environment; is jre/lib/ext really the proper place for log4j
- is Tomcat the only thing in your environment using commons-logging;
if so, force commons-logging to revert to other logging backends
instead of using log4j (if you can't place log4j into such a place
that it doesn't affect Tomcat internals, but still is available to
webapps)

--
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)
Back to top
jim shirreffs
Guest





PostPosted: Sun Nov 13, 2005 8:33 pm    Post subject: Re: logging setup problem with tomcat5.5.7 .... need help pl Reply with quote

Well I found the problem, or rather I found where the problem is, something
in my lib/ext was screwing up Tomcat logging. I removed the lib/ext
directory and logging started working. Now I will look at every jar in
lib/ext and find the offended jar.

thanks HalcyonWild and Juha Laiho

jim s

"Juha Laiho" <Juha.Laiho (AT) iki (DOT) fi> wrote in message
news:dl7a5o$mbd$4 (AT) ichaos (DOT) ichaos-int...
Quote:
"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:

"Juha Laiho" <Juha.Laiho (AT) iki (DOT) fi> wrote in message
news:dl5g2p$u4$1 (AT) ichaos (DOT) ichaos-int...
"jim shirreffs" <jpsb (AT) verizon (DOT) net> said:
I have tried just about everything to get logging working in
tomcat5.5.7.
Can anyone tell me how to get container level logging working? I keep
getting this error
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.ClassLoaderFactory). log4j:WARN Please
initialize the log4j system properly.

This problem is happening on two diferent tomcat installs, I have been
to
Apacte site and done everything thier docs say to do. And still logging
does not work.

Let's gather some data.

Tomcat in itself doesn't contain log4j, so you've placed a log4j
library somewhere, and are apparently also using it somewhere.
If you're using it, you're hopefully also configuring it - how else
could anything be logged, because log4j wouldn't know where to write.

Where exactly did you drop the log4j library? This is important in the
sense that Tomcat used Jakarta commons-logging for its internal logging,
and commons-logging in turn will by default use log4j whenever it is
available. So just throwing a log4j library into a Tomcat installation
has good probability of messing up Tomcat internal logging.

What configuration method are you using for log4j? Is log4j picking
up the configuration? Start Tomcat with -Dlog4j.debug=true in
JAVA_OPTS to find out.

It is also possible to force commons-logging to use a specific logging
backend (note though that if any of your applications run within the
same Tomcat instance use commons-logging, this setting will also affect
those applications). To force commons-logging to not use log4j as
the backend, add
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
to JAVA_OPTS in tomcat startup and restart Tomcat.

I have removed all log4j.jars except the jar in jre/lib/ext, and
Tomcat/common/lib, my Tomcat will not start without the
jre/lib/ext/log4j.jar which I find curious since common/lib is where I
thougt all Tomcat required jars should go. I have also removed all the
log4j.properties files I could find.

jre/lib/ext is at least part of the bootstrap classpath, and I think it
could make its way to some other Tomcat classpaths as well. But now,
what in your setup does require log4j, as plain Tomcat works without
log4j just fine?

My thinking is that Tomcat will default to it's own logging mechanism if
nothing else is available (used to work that way).

The logging mechanism used by Tomcat is Jakarta commons-logging
package, and by default it will use either log4j, the JDK 1.4 logging
subsystem, or its internal simple logger (in this order, as support
classes are found). But as I wrote earlier, this can be overridden with
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
in JAVA_OPTS at tomcat startup. Could you see if this helps you?

Other then server.xml I do not touch Tomcat configuration files. So I
basicly install, modify the server.xml and then run. I also do not use a
classpath when running Tomcat, so the only thing Tomcat should see the
jre/lib/ext and it's own stuff. I did manage to get Tomcat to at least
create log files on one computer (reinstalled everything) but it never
writes to them, the other computer does not even create the log files.

Well, log4j doesn't end in jre/lib/ext by itself, so someone did place
it there. Looks like you should go back to a very clean situation and
trace forward step by step from there, to find out which of your
installs do what behind the scenes. You clearly are not in control of
the situation any more. Stop chaos, take control. Then start building
gain, step by step - and paying attention to what all happens. Then,
if something unexpected happens, you can backtrack just a single step,
instead of redo-all.

What I probably need is a boiler plate lo4j.properties file for Tomcat
that
I can put into common/classes , but the install does not contain one. I've
tried the following as a log4j.properties file but without success.

Don't stagger in the darkness. Find a place where you know which
pieces are affecting the play - and control the playground yourself.
So, don't just place things all over by random guesses - looks
like that's how you ended in your current situation in the first
place.

So, things to determine:
- what in your system requires log4j; is it an essential part of
your environment; is jre/lib/ext really the proper place for log4j
- is Tomcat the only thing in your environment using commons-logging;
if so, force commons-logging to revert to other logging backends
instead of using log4j (if you can't place log4j into such a place
that it doesn't affect Tomcat internals, but still is available to
webapps)

--
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)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java.setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.