The moose likes Other Open Source Projects and the fly likes specifying category name in log4j.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "specifying category name in log4j.xml" Watch "specifying category name in log4j.xml" New topic
Author

specifying category name in log4j.xml

anupa oru
Ranch Hand

Joined: Jan 15, 2005
Posts: 118
Hi Folks,

I would like to specify category name in log4j.xml but at the same time I don't want to hard code it. I need to say all loggers ending with some suffix has to go into particular appender, I guess my question how can specify that in category name in log4j.xml.

pls give ur response ASAP.
Thanks alot,
Anu
anupa oru
Ranch Hand

Joined: Jan 15, 2005
Posts: 118
Waiting for ur responses....
Thanks
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1340
Can you use a prefix instead? (I'm not sure how you would do it with a common suffix.)

For example using package type naming system you can configure a category com.foo with debug level and appender(s) that would apply to Loggers with names that start with com.foo. such as:

com.foo.x
com.foo.x.bar
com.foo.y
 
 
subject: specifying category name in log4j.xml
 
Threads others viewed
jboss sop's
How to disable Struts logging?
Cannot seem to set JK2 LogLevel in Integrated Tomcat
problems with hibernate logs
log4j: DEBUG for one package only...
Two Laptop Bag