You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by James Strachan <ja...@yahoo.co.uk> on 2001/08/18 22:06:44 UTC
standard Log4j initialisation servlet?
Please forgive me if this has been mentioned before, I don't follow this
list very closely.
I just wondered if it would make sense to have a standard Log4jServlet that
could be used in servlet environments to initialise Log4j. Since its just
one class I'd prefer it to be in the log4j distribution. I've found various
projects I've worked on all write their own - which apart from duplication
of effort, could result in a bad initialisation (e.g. logging messages many
times).
A user of the log4j taglib at jakarta-taglibs has found that
log4j.properties is not found in the WEB-INF/classes directory on Tomcat 3.2
and JRun 3.1 - (have others found this too?) - so rather than asking each
user to write a servlet, having one in log4j.jar that could be added to
web.xml seems to make sense. I could add a servlet to log4j taglib but it
seems like log4j.jar is a better place for such a thing that a taglib that
happens to use log4j.
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
Re: standard Log4j initialisation servlet?
Posted by Christopher Taylor <cs...@java-internals.com>.
Hi James,
In the FAQ (the committed one, not the one on the website), there's a
suggstion to try the following in your Servlet:
Thread.currentThread().getContextClassLoader().getResource("log4j.properties
");
And see if you get null back. If you get the URL back correctly, then
you're probably using an older version of Log4J.
Let me know if this works out for you.
-Chris
----- Original Message -----
From: "James Strachan" <ja...@yahoo.co.uk>
To: <lo...@jakarta.apache.org>
Sent: Sunday, August 19, 2001 5:06 AM
Subject: standard Log4j initialisation servlet?
> Please forgive me if this has been mentioned before, I don't follow this
> list very closely.
>
> I just wondered if it would make sense to have a standard Log4jServlet
that
> could be used in servlet environments to initialise Log4j. Since its just
> one class I'd prefer it to be in the log4j distribution. I've found
various
> projects I've worked on all write their own - which apart from duplication
> of effort, could result in a bad initialisation (e.g. logging messages
many
> times).
>
> A user of the log4j taglib at jakarta-taglibs has found that
> log4j.properties is not found in the WEB-INF/classes directory on Tomcat
3.2
> and JRun 3.1 - (have others found this too?) - so rather than asking each
> user to write a servlet, having one in log4j.jar that could be added to
> web.xml seems to make sense. I could add a servlet to log4j taglib but it
> seems like log4j.jar is a better place for such a thing that a taglib that
> happens to use log4j.
>
> James
>
>
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org