You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pompiuses <po...@hotmail.com> on 2006/08/22 16:09:58 UTC
Log4j and Tomcat problem
I'm using Tomcat 5.0.30 running on Ubuntu Linux (6.06).
I've made a small webapp which runs fine under Tomcat on Windows, but on
Linux I've got a problem with log4j.
I've put "commons-logging-1.1.jar" and "log4j-1.2.13.jar" in the webapp libs
directory ($CATALINA_HOME/webapps/ROOT/WEB-INF/lib). In the webapp classes
directory I've put log4j.properties.
The problem is that the webapp won't even run as long as
"commons-logging-1.1.jar" is in the class path. If I remove it, the webapp
will run but there's no logging.
Then I tried putting log4j.properties in $CATALINA_HOME/shared/classes and
$CATALINA_HOME/common/classes, but it still wouldn't log anything.
No error messages is written to system.out (/var/log/tomcat5/catalina.out)
or any of the Tomcat log files.
My log4j.properties look like this (just prints to the console):
# The log4j configuration file.
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n
How can I test if log4j.properties really is in the classpath? Perhaps it's
missing from the classpath?
Perhaps using the ROOT directory for my webapp is a bad idea?
Any comments and suggestions are welcome :-)
--
View this message in context: http://www.nabble.com/Log4j-and-Tomcat-problem-tf2146529.html#a5926291
Sent from the Tomcat - User forum at Nabble.com.
---------------------------------------------------------------------
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: Log4j and Tomcat problem
Posted by Boris Unckel <bo...@gmx.net>.
-------- Original-Nachricht --------
Datum: Tue, 22 Aug 2006 07:09:58 -0700 (PDT)
Von: pompiuses <po...@hotmail.com>
An: users@tomcat.apache.org
Betreff: Log4j and Tomcat problem
>
> I'm using Tomcat 5.0.30 running on Ubuntu Linux (6.06).
>
> I've made a small webapp which runs fine under Tomcat on Windows, but on
> Linux I've got a problem with log4j.
>
> I've put "commons-logging-1.1.jar" and "log4j-1.2.13.jar" in the webapp
> libs
> directory ($CATALINA_HOME/webapps/ROOT/WEB-INF/lib). In the webapp classes
> directory I've put log4j.properties.
That is the best way to avoid problems, so further tries should rely on that.
Maybe Tomcat 5.0.30 delivers an old commons-logging-api.jar. Have a look at
http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#Jars_Included_in_the_Standard_Distribution
and try to find the correct combination of
a) replacing the old version with the current commons-logging inside tomcat
b) replace WEB-INF/lib/commons-logging-1.1.jar with commons-logging-adapters.jar
Force commons-logging 1.1 with JVM parameter
-Dorg.apache.commons.logging.diagnostics.dest=STDOUT
to give you a trace of what it does. If you still have errors - please post this trace.
Please send back your solution to the list...
Regards
Boris
---------------------------------------------------------------------
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: Log4j and Tomcat problem
Posted by Lou Caudell <lc...@wtceng.com>.
pompiuses wrote:
> I'm using Tomcat 5.0.30 running on Ubuntu Linux (6.06).
>
> I've made a small webapp which runs fine under Tomcat on Windows, but on
> Linux I've got a problem with log4j.
>
> I've put "commons-logging-1.1.jar" and "log4j-1.2.13.jar" in the webapp libs
> directory ($CATALINA_HOME/webapps/ROOT/WEB-INF/lib). In the webapp classes
> directory I've put log4j.properties.
>
> The problem is that the webapp won't even run as long as
> "commons-logging-1.1.jar" is in the class path. If I remove it, the webapp
> will run but there's no logging.
>
> Then I tried putting log4j.properties in $CATALINA_HOME/shared/classes and
> $CATALINA_HOME/common/classes, but it still wouldn't log anything.
>
> No error messages is written to system.out (/var/log/tomcat5/catalina.out)
> or any of the Tomcat log files.
>
> My log4j.properties look like this (just prints to the console):
>
> # The log4j configuration file.
> log4j.rootLogger=debug, R
> log4j.appender.R=org.apache.log4j.ConsoleAppender
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
> log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n
>
>
> How can I test if log4j.properties really is in the classpath? Perhaps it's
> missing from the classpath?
>
> Perhaps using the ROOT directory for my webapp is a bad idea?
>
> Any comments and suggestions are welcome :-)
>
>
Couple of things,
1) Try putting the log4j*.jar in tomcat*\commons\lib and see if it works..
2) You may be missing the jtds*.jar.
- Lou Caudell
---------------------------------------------------------------------
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: Log4j and Tomcat problem
Posted by zh rui <ru...@gmail.com>.
hi pompiuses <
if you don't use vi , instead of using tail -f ...
On 8/24/06, pompiuses <po...@hotmail.com> wrote:
>
>
> Found a solution:
> I had installed Tomcat through the Ubuntu Synaptic Package manager. It
> would
> seem this was not a healthy install, because I just uninstalled it and
> installed Tomcat 5.5 manually and everything worked perfectly. What the
> problem was I never figured out since the install was scattered all over
> the
> hard drive.
>
> The only thing that bothers me now is that if I open up /var/log/ne/ne.log
> in a text editor, say vi, and edit it, log4j will stop logging to the
> file.
> I have to restart the webapp to make it start logging again. Anyone know
> what might cause that?
>
> --
> View this message in context:
> http://www.nabble.com/Log4j-and-Tomcat-problem-tf2146529.html#a5960847
> Sent from the Tomcat - User forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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
>
>
--
from rui.zhg
Re: Log4j and Tomcat problem
Posted by pompiuses <po...@hotmail.com>.
Found a solution:
I had installed Tomcat through the Ubuntu Synaptic Package manager. It would
seem this was not a healthy install, because I just uninstalled it and
installed Tomcat 5.5 manually and everything worked perfectly. What the
problem was I never figured out since the install was scattered all over the
hard drive.
The only thing that bothers me now is that if I open up /var/log/ne/ne.log
in a text editor, say vi, and edit it, log4j will stop logging to the file.
I have to restart the webapp to make it start logging again. Anyone know
what might cause that?
--
View this message in context: http://www.nabble.com/Log4j-and-Tomcat-problem-tf2146529.html#a5960847
Sent from the Tomcat - User forum at Nabble.com.
---------------------------------------------------------------------
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