wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Log4J Configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4J Configuration" Watch "Log4J Configuration" New topic
Author

Log4J Configuration

Sylvia H Charbonneau
Ranch Hand

Joined: Jul 11, 2002
Posts: 37
Good Day !
I'm looking for some opinions. What is the most commonly used way to initialize and configure log4j under Tomcat ? The three means I have read about are :
a) a text properties file
b) an xml properties file
c) doing the aboe with a intialization servlet.
I'll be using log4j in some custom tags being accessed from JSP pages running on Tomcat.
I'm ordering some books on this topic, however, it would be great if I can get a jump start in this area while I'm waiting !
Thanks !
Sylvia
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I'm guessing most people use #1, a text properties file. Because it's been around longer than the xml properties file.
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
I choose a) a text properties file, like most people.
Mike Wang
Ranch Hand

Joined: May 09, 2003
Posts: 76
a) is suitable for simple works
b) is suitable for complex works
c) is suitable for demo and teaching purpose
Originally posted by Sylvia H Charbonneau:
Good Day !
I'm looking for some opinions. What is the most commonly used way to initialize and configure log4j under Tomcat ? The three means I have read about are :
a) a text properties file
b) an xml properties file
c) doing the aboe with a intialization servlet.
I'll be using log4j in some custom tags being accessed from JSP pages running on Tomcat.
I'm ordering some books on this topic, however, it would be great if I can get a jump start in this area while I'm waiting !
Thanks !
Sylvia


SCJP1.4<br />SCWCD 1.4 (Beta)<br />SCMAD 1.0 (Beta)<br />SCDJWS (Beta)<br />SCBCD 1.3 <br />SCJD <br />SCEA (Prepairing)<br />"I am mike, not milk"
vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 395
I have used it as a properties file (txt file). I find it the easiest to do. Mike, how can using as an XML file make it easier for complex works? Can you please elaborate on it?
Thanks,
vasu


What a wonderful world!
M. A. McAngus
Greenhorn

Joined: May 04, 2004
Posts: 1
vasu maj asks:
I have used it as a properties file (txt file). I find it the easiest to do.
Mike, how can using as an XML file make it easier for complex works?
Can you please elaborate on it?

I'm not Mike, and I realize that this question has been around for a few weeks. Still, I'll try to answer it.
From the Log4J Javadocs:

hth
MAM
[ May 04, 2004: Message edited by: M. A. McAngus ]
Sylvia H Charbonneau
Ranch Hand

Joined: Jul 11, 2002
Posts: 37
Thanks Gang !!
I did some experimenting, and found that xml config files were much easier to use that text properties files. I've chosen to go with those.
Thanks again!
S
 
 
subject: Log4J Configuration
 
Similar Threads
Logging in struts
Path to locate properties file of log4j
Log4j only reads log4j.properties in $CATALINA_HOME/lib
How not to hard-code file location in java?
Log4j and WebSphere - the standard WebSphere SystemOutput.Is this how it should work?