如何在我的应用程序中使用 jboss-log4j.xml

发布于 2024-09-08 03:38:07 字数 84 浏览 2 评论 0原文

可以使用 jboss-log4j.xml 作为我的应用程序的配置文件吗? 我只想让我的应用程序登录到与 Jboss 服务器(控制台和文件)相同的位置...

It is possible to use jboss-log4j.xml as configuration file for my application ?
I just want my application to log in the same place as Jboss server(console and file)...

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

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

发布评论

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

评论(2

善良天后 2024-09-15 03:38:08

如果您想使用与 JBoss 相同的日志记录规则,那么您可以从应用程序引用现有的 jboss-log4j.xml 文件。否则,您可以将相关输出部分复制到特定于您的应用程序的单独文件中。我会推荐第二种方法。

If you want to use all the same logging rules as JBoss then you can reference your existing jboss-log4j.xml file from your app. Otherwise, you could just copy the relevant output sections into a separate file specific to your app. I would recommend the 2nd approach.

写下不归期 2024-09-15 03:38:07

JBoss 对每个应用程序使用单个全局 log4j 配置。您的应用对 log4j 进行的任何调用都将通过 jboss-log4j.xml 中的配置进行路由。您应该随意修改该文件以适合您的应用程序 - 它决定哪些记录器使用哪些文件。

默认情况下,您的应用程序日志将转到与 JBoss 本身日志相同的文件。

JBoss uses a single global log4j configuration for every application. Any calls your app makes to log4j will be routed via the config in jboss-log4j.xml. You should feel free to modify that file to suit your application(s) - it determines which loggers use which files.

By default, your application(s) logs will will go to the same file(s) as JBoss itself logs to.

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