Category VS logger tags in jboss-log4j.xml
Wha开发者_运维问答t should we use in jboss-log4j.xml in order to turn on/off traces for our product - "category" or "logger" tag?
By default JBoss uses "category" in jboss-log4j.xml.
But as far as I know "category" is deprecated and "logger" should be used instead. Why JBoss uses deprecated "category" tag in a new product?Habit, I suspect. I still to use category
also. It behaves exactly the same as logger
, there really is no difference.
category
in the log4j.xml (not limited to jboss-log4j.xml) is common practice and its not deprecated. What got deprecated is the Category Class
as in usage of Category
in code like,
Category category = Category.getInstance('something');
In log4j.xml, both category and logger can be used. Probably the newer code will have the logger
in log4j.xml. Old way is category
.
精彩评论