Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

specifying category name in log4j.xml

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Waiting for ur responses....
Thanks
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic