• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!