Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4J Configuration

 
Sylvia H Charbonneau
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I choose a) a text properties file, like most people.
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
M. A. McAngus
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic