Brian,
Are you calling PropertyConfigurator explicitly anywhere in your code?
Brian McGovern wrote:
Hi. I've got tomcat up and running and have a log4j.properties file in my WEB-INF\classes directory. My servlets and jsps run fine. No errors.
Stdout.log shows this on servlet execution and i
, 2005 5:51 PM
To: Tomcat Users List
Subject: Re: log4j in tomcat erroring -- dont know why
Brian,
Are you calling PropertyConfigurator explicitly anywhere in your code?
Brian McGovern wrote:
Hi. I've got tomcat up and running and have a log4j.properties file in my
WEB-INF\classes directory
On Thu, Dec 09, 2004 at 04:33:33PM -0600, Jacob Kjome wrote:
For your own app, do you use actually use the commons-logging api or
just the Log4j api? If the latter, don't bother with
commons-logging. In fact, try to avoid it like the plague.
Could you expand on this? I've wondered in
At 03:17 PM 12/16/2004 -0500, you wrote:
On Thu, Dec 09, 2004 at 04:33:33PM -0600, Jacob Kjome wrote:
For your own app, do you use actually use the commons-logging api or
just the Log4j api? If the latter, don't bother with
commons-logging. In fact, try to avoid it like the plague.
Hi,
-Original Message-
From: Dale, Matt [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 12, 2004 5:22 PM
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5
Hopefully I explained things better and piqued your curiosity about
repostiory
selectors in Log4j-1.3 :-)
You certainly
Hi,
Shameless plug accepted, is there somewhere I can download it or do I need to
get it from CVS?
Ta
Matt
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: 13 December 2004 14:02
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5
Hi,
-Original Message
Hi,
Shameless plug accepted, is there somewhere I can download it or do I
need
to get it from CVS?
The download page: http://logging.apache.org/site/binindex.html.
Yoav Shapira http://www.yoavshapira.com
This e-mail, including any attachments, is a confidential business
communication, and
ignore that, found the binary download.
Ta
Matt
-Original Message-
From: Dale, Matt
Sent: 13 December 2004 14:37
To: Tomcat Users List
Subject: RE: log4j and tomcat 5.5
Hi,
Shameless plug accepted, is there somewhere I can download it or do I need to
get it from CVS?
Ta
Matt
: Re: log4j and tomcat 5.5
Quoting Marcelo Moreira [EMAIL PROTECTED]:
On Thu, 9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
Are you trying to enable logging for Tomcat, your webapp, or both? You
will
need to add both log4j.jar and commons-logging.jar (not
commons-logging
Are you trying to enable logging for Tomcat, your webapp, or both? You will
need to add both log4j.jar and commons-logging.jar (not
commons-logging-api.jar) to common/lib to enable Log4j logging for Tomcat-5.5.x
itself. For your own app, do you use actually use the commons-logging api or
just
On Thu, 9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
Are you trying to enable logging for Tomcat, your webapp, or both? You will
need to add both log4j.jar and commons-logging.jar (not
commons-logging-api.jar) to common/lib to enable Log4j logging for
Tomcat-5.5.x
Quoting Marcelo Moreira [EMAIL PROTECTED]:
On Thu, 9 Dec 2004 16:33:33 -0600, Jacob Kjome [EMAIL PROTECTED] wrote:
Are you trying to enable logging for Tomcat, your webapp, or both? You
will
need to add both log4j.jar and commons-logging.jar (not
commons-logging-api.jar) to common/lib
Log4j looks on your class path for a properties file
log4j.properties. If you put the file in WEB-INF/classes
it will find it.
Here's a real simple example:
log4j.rootCategory=DEBUG, dest1
log4j.appender.dest1=org.apache.log4j.RollingFileAppender
I just did that. I have a log4j.properties file with the following:
# initialise root logger with level DEBUG and call it A1
log4j.rootLogger=DEBUG, A1
# set the appender to be FileAppender
log4j.appender.A1=org.apache.log4j.FileAppender
# set set that layout to be SimpleLayout
I just did that. I have a WEB-INF/classes/log4j.properties file with
the following:
# initialise root logger with level DEBUG and call it A1
log4j.rootLogger=DEBUG, A1
# set the appender to be FileAppender
log4j.appender.A1=org.apache.log4j.FileAppender
# set set that layout to be SimpleLayout
Try pulling out the:
PropertyConfigurator.configure(log4j.properties)
line.
You shouldn't need it.
Just let log4j find it in your classes directory.
On Thu, 2004-10-28 at 20:14, Mufaddal Khumri wrote:
I just did that. I have a WEB-INF/classes/log4j.properties file with
the following:
#
Ah, sorry. I didn't look closely enough at your code.
The first example on this page shows how to read a properties file
using getResourceAsStream(). Use that to get the properties file for the
Configurator.
http://nagoya.apache.org/wiki/apachewiki.cgi?Tomcat/Howto
On Thu, 2004-10-28
Hi,
Hmm, it's possible that now that we've moved Tomcat's bootstrapping code
to also use commons-logging, the impl lib is needed on the bootstrap
classpath. I'll amend the FAQ entry to also link to this thread and
give some though to updating the documentation-proper (as opposed to the
FAQ) on
Yoav,
Thanks for that update. With that explination I now have two
questions, one of which is slightly off-topic:
1. The author of the message pointed to in the FAQ (can't get to the
message archive at this moment for their name) says they used a stock
5.0.19 install on Windows and got it to
a separate section on logging with some
additional/updated info.
Yoav Shapira
Millennium Research Informatics
-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 07, 2004 10:30 AM
To: Tomcat Users List
Subject: Re: Log4J in Tomcat 5.0...I don't believe
I went through all of these problems myself when I tried to get Log4j
working as my system logger in Tomcat 5.0.27. I followed the directions in
the FAQ but log4j was not being detected on bootup. I too modified the
catalina.sh startup script and added the log4j.jar file to the classpath
and even
On Tue, 07 Sep 2004 13:02:27 -0400, Geoff [EMAIL PROTECTED] wrote:
The correct way to install Log4j as your Tomcat 5.0 system logger is:
1) Shutdown Tomcat.
2) Install commons-logging.jar into common/lib.
3) Install log4j-1.2.8.jar into common/lib
4) Create an appropriate log4j.properties
Hi,
No -- different answers apply to different Tomcat versions.
Yoav Shapira
Millennium Research Informatics
-Original Message-
From: Patrick Burleson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 07, 2004 3:11 PM
To: Tomcat Users List
Subject: Re: Log4J in Tomcat 5.0...I don't
Kjome [mailto:[EMAIL PROTECTED]
Enviado el: domingo, 05 de septiembre de 2004 23:55
Para: Tomcat Users List
Asunto: RE: Log4J in Tomcat 5.0...I don't believe the FAQ
Why do you use commons-logging in your application classes? I can see a
semi-legitimate argument for a framework doing this, so
In case it helps, this is what I do with Tomcat 5.0.28 (Win 2000 without
installer, j2sdk1.4.2_04):
- I do not put log4j.jar in commom/lib, but in the WEB-INF/lib of my web
app.
- I put log4j.xml (equivalent to log4j.properties) and
commons-logging.properties in WEB-INF/classes of my app.
The
Why do you use commons-logging in your application classes? I can see a
semi-legitimate argument for a framework doing this, so as to not force a
particular logging implementation on the user. However, you are the
user. You choose the logging implementation. You have, obviously, chosen
Thanks for that, but that's not exactly what I am asking for. I know
that putting log4j into my webapp will work. What I want to do is to
have Tomcat *itself* use log4j for logging statements. The messages I
linked to say that it's very simple to do. Yet following the
instructions, it doesn't work
Howdy,
It's pretty much all covered in the log4j documentation. It's covered
in depth in the full log4j book which you can purchase.
Don't confuse the Logger tags in tomcat's server.xml with log4j
Loggers. They're not the same.
Here's a way to get started:
- Go through the log4j introduction
I really liked this page:
http://www.vipan.com/htdocs/log4jhelp.html
It helped me get started with log4j. One warning though, it is out of
date, so you'll have to change some of the code examples. But otherwise,
the other stuff is still pretty relevant.
-Original Message-
From:
Howdy,
Is there a way to tell log4j to use the properties file without relying
on the class loader, like an environment variable or something? That
might make it easier to use.
PropertyConfigurator.configure(getServletContext().getResource(/WEB-INF
/config/log4j.properties)); would do the
2003 18:14
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
Hey Jim,
Can you help me understand your configuration so I can help identify
where the breakdown is? I am most curious about where all the
jar files
are - common/lib, shared/lib, or WEB-INF/lib
Hey Jim,
I think Yoav's answer is very practical, and in spite of the fact that
it would require a code change if you change loggers down the road, it
is only a few lines in one place. You should think about it, because it
is pretty low-cost, compared to the amount of time we have already
spent.
: RE: Log4J and tomcat using Commons logging
Hey Jim,
I think Yoav's answer is very practical, and in spite of the fact that
it would require a code change if you change loggers down the road, it
is only a few lines in one place. You should think about it,
because it
is pretty low-cost
:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 1:03 PM
To: Tomcat Users List
Subject: Re: Log4J and tomcat
I'll keep you posted if I ever figure something out.
The problem prob. is that since the common-logging and log4j
use a lot
of
static objects I'm getting what tomcat has already
to a large number
of
users.
Many thanks
Jim.
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2003 18:11
To: Tomcat Users List
Subject: RE: Log4J and tomcat
Howdy,
FYI: we deploy in packed .war files (and have
unpackWARs=false in the
Host
:[EMAIL PROTECTED]]
Sent: 14 February 2003 15:40
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
Where are your commons-logging and log4j jars?
If they are loaded by a different classloader than the
log4j.properties
file, it may not work.
Larry
[EMAIL
.
Regards
Jim.
-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2003 15:40
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
Where are your commons-logging and log4j jars?
If they are loaded by a different classloader
2003 17:11
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
I have never used log4j, but you might try putting the
log4j.properties
file in common/classes, it means all apps get the same log
settings, but
may work. :-/
Is there a way to tell log4j to use
. With commons-logging you do not log to
any
particular logging implementation.
Regards
Jim.
-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2003 17:11
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
I have never used log4j
Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing
-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]]
Sent: February 14, 2003 1:14 PM
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
Hey Jim,
Can you help me understand your
Thinks He Knows Everything
This Guy Thinks He Knows What He Is Doing
-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED]]
Sent: February 14, 2003 1:14 PM
To: [EMAIL PROTECTED]
Subject: RE: Log4J and tomcat using Commons logging
Hey Jim,
Can you help me understand your
Sloan, sorry can't help you out but if you find a solution I'd be interested
in how you came up with the fix... Learnin about log4j it could help in the
future
- Original Message -
From: Sloan Seaman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, February 12, 2003 3:23 PM
Users List [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 12:57 PM
Subject: Re: Log4J and tomcat
Sloan, sorry can't help you out but if you find a solution I'd be
interested
in how you came up with the fix... Learnin about log4j it could help in
the
future
- Original Message
13, 2003 1:03 PM
To: Tomcat Users List
Subject: Re: Log4J and tomcat
I'll keep you posted if I ever figure something out.
The problem prob. is that since the common-logging and log4j use a lot
of
static objects I'm getting what tomcat has already set up (this is a
theory
mind you
Try putting log4j.jar in your WEB-INF/lib directory, and your log4j.props in
your classes directory.
or
set up a servlet that loads on startup that uses the log4j method to define
the path to your prop file, in the init().
-Original Message-
From: Sloan Seaman [mailto:[EMAIL PROTECTED]]
it somewhere...
- Original Message -
From: Ron Day [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 1:15 PM
Subject: RE: Log4J and tomcat
Try putting log4j.jar in your WEB-INF/lib directory, and your log4j.props
in
your classes directory.
or
set up
-Original Message-
From: Sloan Seaman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 11:03 AM
To: Tomcat Users List
Subject: Re: Log4J and tomcat
I'll keep you posted if I ever figure something out.
The problem prob. is that since the common-logging and log4j
use a lot
Why put the log4j configuration file in the classpath if you are
initializing it in an init servlet? Just put it alongside your web.xml
file in
WEB-INF. Only put it in WEB-INF/classes if you want log4j to perform
default initializationand call it log4j.xml or log4j.properties
otherwise
Ug, the first line is confusing. I had two different trains of thought
going there. It should read why put the log4j configuration file in the
classpath.
Jake
At 10:04 PM 12/25/2002 -0600, you wrote:
Why put the log4j configuration file in the classpath if you are
initializing it in an
I think I know what the problem is. To add log4j to Tomcat you added an
extra parameter to either startup.bat or catalina.bat right? (I can't
remember which one.) So when you start Tomcat from the start menu it
reads the change you made in the file.
Thing is, when Tomcat starts as a service
-
From: Charles N. Harvey III [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 10:01 AM
To: Tomcat Users List
Subject: RE: log4j in tomcat
I think I know what the problem is. To add log4j to Tomcat you added an
extra parameter to either startup.bat or catalina.bat right? (I can't
You can try the following:
String propPath =
conf.getServletContext().getResource(/WEB-INF/classes/log4j.properties);
PropertyConfigurator.configure(propPath);
...
regards
Winfried
Hello there!
I was wondering if anybody could help with a tomcat
and log4j problem?
I have placed
Oops, correcting...
String propPath =
conf.getServletContext().getResource(/WEB-INF/classes/log4j.properties).getPath();
PropertyConfigurator.configure(propPath);
...
Hello there!
I was wondering if anybody could help with a tomcat
and log4j problem?
I have placed my log4j.properties file into my
WEB-INF/classes direcotry but it seems that Tomcat is
not picking it up!
This is the line in my code in my .java file taht
tells me what .properties file to look
On Wed, 28 Mar 2001, Ceki [iso-8859-1] Gülcü wrote:
Hello,
I would like to inquire about the status of log4j in Tomcat 4.x, more
specifically in Catalina. I had heard through the grapevine that
Catalina was going to use log4j internally. Is this correct? Thanks
for any info on this
Yes it can.
You might want to consider creating a log4j.properties file to hold your log4j
configuration. Have that file in your WEB-INF/classes dir and tomcat would
automatically pick it up.
HTH.
Anuj.
teh j wrote:
I have recently started playing with log4j. Does
anybody know if it can be
56 matches
Mail list logo