You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by fredk2 <fr...@gmail.com> on 2007/08/18 02:08:36 UTC
Can we use output/extras/tomcat-juli.jar by default?
Hi,
To use log4j the documentation
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
suggest that we need to:
1. Replace $CATALINA_HOME/bin/tomcat-juli.jar with the
output/extras/tomcat-juli.jar.
2. Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
What do these file do? why are they extras and why not have them in the
default build?
In my quick basic tests I did not observe any difference in the logging
behaviors when compared to the original tomcat-juli.jar. Can anyone explain
how or when this would become a problem?
Many Thanks - Fred
--
View this message in context: http://www.nabble.com/Can-we-use-output-extras-tomcat-juli.jar-by-default--tf4288716.html#a12209126
Sent from the Tomcat - User mailing list archive 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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Mark Thomas <ma...@apache.org>.
Matthew Kerle wrote:
> ok, found the following:
> http://issues.apache.org/bugzilla/show_bug.cgi?id=26372
> &
> http://issues.apache.org/bugzilla/show_bug.cgi?id=27371 (depended-on)
>
> is that the one you mean?
This wasn't one of the ones I was thinking of.
> we use commons-logging so we've never encountered any of these issues,
> but now I know a good reason not to use log4j on tomcat, thanks!
Of commons-logging and log4j, my impression (haven't counted the bugs)
is that (mis)-use of commons-logging has caused more memory leak
issues than log4j on its own.
Mark
---------------------------------------------------------------------
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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Matthew Kerle <ma...@sra.com.au>.
ok, found the following:
http://issues.apache.org/bugzilla/show_bug.cgi?id=26372
&
http://issues.apache.org/bugzilla/show_bug.cgi?id=27371 (depended-on)
is that the one you mean?
we use commons-logging so we've never encountered any of these issues,
but now I know a good reason not to use log4j on tomcat, thanks!
Mark Thomas wrote:
> Matthew Kerle wrote:
>
>> let me know if I read that right...
>>
>> Bill Barker wrote:
>>
>>> When you have the log4j jar in WEB-INF/lib, the it ends up being used
>>> by Tomcat for some of it's logging. As a result, it can cause memory
>>> leaks and other weird errors when a context is stopped and started.
>>> This isn't a problem with j.u.l since the classes are loaded by the
>>> system classloader. That is why Tomcat decided to use j.u.l for it's
>>> internal logging by default.
>>>
>>>
>> does this mean that including log4j in my deployment WAR could
>> potentially cause memory leaks and problems with tomcat? I've never
>> heard of this, I thought that log4j played well with others, has anyone
>> else experienced this / are there any links that describe this problem/
>>
>
> Yes. Have a look in Bugzilla for details. Most have been fixed but I
> think there are still a few scenarios that can cause trouble.
>
> FWIW, I use log4j in my own web apps at work and they stay up for
> months with a fair number of reloads and no obvious memory leaks.
>
> Mark
>
>
> ---------------------------------------------------------------------
> 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
>
>
--
* Matthew Kerle
* * IT Consultant *
* Canberra, Australia*
Mobile: +61404 096 863
Email: mattkerle@gmail.com <ma...@gmail.com>
Web: Matthew Kerle <http://threebrightlights.blogspot.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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Mark Thomas <ma...@apache.org>.
Matthew Kerle wrote:
> let me know if I read that right...
>
> Bill Barker wrote:
>> When you have the log4j jar in WEB-INF/lib, the it ends up being used
>> by Tomcat for some of it's logging. As a result, it can cause memory
>> leaks and other weird errors when a context is stopped and started.
>> This isn't a problem with j.u.l since the classes are loaded by the
>> system classloader. That is why Tomcat decided to use j.u.l for it's
>> internal logging by default.
>>
> does this mean that including log4j in my deployment WAR could
> potentially cause memory leaks and problems with tomcat? I've never
> heard of this, I thought that log4j played well with others, has anyone
> else experienced this / are there any links that describe this problem/
Yes. Have a look in Bugzilla for details. Most have been fixed but I
think there are still a few scenarios that can cause trouble.
FWIW, I use log4j in my own web apps at work and they stay up for
months with a fair number of reloads and no obvious memory leaks.
Mark
---------------------------------------------------------------------
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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Matthew Kerle <ma...@sra.com.au>.
let me know if I read that right...
Bill Barker wrote:
> When you have the log4j jar in WEB-INF/lib, the it ends up being used by Tomcat for some of it's logging. As a result, it can cause memory leaks and
> other weird errors when a context is stopped and started. This isn't a
> problem with j.u.l since the classes are loaded by the system classloader.
> That is why Tomcat decided to use j.u.l for it's internal logging by
> default.
>
does this mean that including log4j in my deployment WAR could
potentially cause memory leaks and problems with tomcat? I've never
heard of this, I thought that log4j played well with others, has anyone
else experienced this / are there any links that describe this problem/
cheers.
--
Matthew Kerle
IT Consultant
Canberra, Australia
Mobile: +61404 096 863
Email : mattkerle@gmail.com
Web : http://threebrightlights.blogspot.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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Bill Barker <wb...@wilshire.com>.
"fredk2" <fr...@gmail.com> wrote in message
news:12209126.post@talk.nabble.com...
>
> Hi,
>
> To use log4j the documentation
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> suggest that we need to:
>
> 1. Replace $CATALINA_HOME/bin/tomcat-juli.jar with the
> output/extras/tomcat-juli.jar.
>
> 2. Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
>
> What do these file do? why are they extras and why not have them in the
> default build?
>
> In my quick basic tests I did not observe any difference in the logging
> behaviors when compared to the original tomcat-juli.jar. Can anyone
> explain
> how or when this would become a problem?
>
When you have the log4j jar in WEB-INF/lib, the it ends up being used by
Tomcat for some of it's logging. As a result, it can cause memory leaks and
other weird errors when a context is stopped and started. This isn't a
problem with j.u.l since the classes are loaded by the system classloader.
That is why Tomcat decided to use j.u.l for it's internal logging by
default.
> Many Thanks - Fred
> --
> View this message in context:
> http://www.nabble.com/Can-we-use-output-extras-tomcat-juli.jar-by-default--tf4288716.html#a12209126
> Sent from the Tomcat - User mailing list archive 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
>
>
---------------------------------------------------------------------
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: Can we use output/extras/tomcat-juli.jar by default?
Posted by fredk2 <fr...@gmail.com>.
Hi,
If I understand Filip's answer correctly... the difference between the
default tomcat-juli.jar and the output/extras/tomcat-juli.jar is that the
first one is some glue code that hardcodes commons-logging to work only
with java.util.logging and the second supports the "complete"
commons-logging - therefore also log4j.
So am I correct to think that it does not hurt to have the "extras"
tomcat-juli.jar and tomcat-juli-adapters.jar in the ${catalina.home}/lib,
without log4j.jar, and still successfully log by configuring a j.u.l
${catalina.base}/conf/logging.properties ?
Bill's comment is an interesting one. I remember seeing somewhere (tomcat
docs?) a warning against app reloading; that doing so was a memory leak soon
or later.
Many Thanks - Fred
fredk2 wrote:
> Hi,
>
> To use log4j the documentation
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> suggest that we need to:
>
> 1. Replace $CATALINA_HOME/bin/tomcat-juli.jar with the
> output/extras/tomcat-juli.jar.
>
> 2. Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
>
> What do these file do? why are they extras and why not have them in the
> default build?
>
they enable you to plug in commons-logging if you want to use that
instead of java.util.logging
Filip
> In my quick basic tests I did not observe any difference in the logging
> behaviors when compared to the original tomcat-juli.jar. Can anyone
> explain
> how or when this would become a problem?
>
> Many Thanks - Fred
>
---------------------------------------------------------------------
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
--
View this message in context: http://www.nabble.com/Can-we-use-output-extras-tomcat-juli.jar-by-default--tf4288716.html#a12245350
Sent from the Tomcat - User mailing list archive 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: Can we use output/extras/tomcat-juli.jar by default?
Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
fredk2 wrote:
> Hi,
>
> To use log4j the documentation
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html
> suggest that we need to:
>
> 1. Replace $CATALINA_HOME/bin/tomcat-juli.jar with the
> output/extras/tomcat-juli.jar.
>
> 2. Place output/extras/tomcat-juli-adapters.jar in $CATALINA_HOME/lib.
>
> What do these file do? why are they extras and why not have them in the
> default build?
>
they enable you to plug in commons-logging if you want to use that
instead of java.util.logging
Filip
> In my quick basic tests I did not observe any difference in the logging
> behaviors when compared to the original tomcat-juli.jar. Can anyone explain
> how or when this would become a problem?
>
> Many Thanks - Fred
>
---------------------------------------------------------------------
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