jboss-log4j.xml 中的类别 VS 记录器标签

发布于 2024-08-25 03:49:19 字数 172 浏览 1 评论 0原文

我们应该在 jboss-log4j.xml 中使用什么来打开/关闭我们产品的跟踪 - “类别”或“记录器”标签?

默认情况下,JBoss 在 jboss-log4j.xml 中使用“类别”。
但据我所知,“类别”已被弃用,应使用“记录器”。
为什么 JBoss 在新产品中使用已弃用的“类别”标签?

What 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你怎么敢 2024-09-01 03:49:19

习惯,我怀疑。我仍然使用category。它的行为与 logger 完全相同,实际上没有区别。

Habit, I suspect. I still to use category also. It behaves exactly the same as logger, there really is no difference.

灯下孤影 2024-09-01 03:49:19

log4j.xml(不限于jboss-log4j.xml)中的category是常见做法,并且不推荐使用。被弃用的是 Category 类,就像在代码中使用 Category 一样,

Category category = Category.getInstance('something');

在 log4j.xml 中,类别和记录器都可以使用。较新的代码可能会在 log4j.xml 中包含 logger。旧的方式是类别

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文