Glassfish 记录到多个 .log 文件

发布于 2024-09-12 05:46:56 字数 691 浏览 3 评论 0原文

我们有 Glassfish v2 服务器和一些模块:EJB、Web 应用程序等...... 我们需要将不同模块的日志记录到不同的日志文件中,就像 Tomcat 或其他应用程序服务器允许的那样。

Glassfish 迫使我们使用它自己的日志系统,所有日志都在单个 server.log 中并使用管理控制台查看。

对于使用 glassfish 部署的单个应用程序来说,将所有日志保存在一个文件中可能是一种很好的做法但对于在同一服务器上工作的 10 个不同的应用程序

来说则不然 ="http://wiki.glassfish.java.net/Wiki.jsp?page=FaqCongifureLog4J" rel="nofollow noreferrer">在 GF 中配置 log4j,它有帮助,我能够写入多个文件,< em>但是它有一个缺点 - 如果 log4j 以这种方式安装,它可能允许您写入多个日志文件,但是它需要服务器/域重新启动才能修改日志级别、日志文件(log4 conf 中的任何日志相关配置)


可以使用 Glassfish 中的任何内容来允许我:

  1. 将来自不同记录器的日志写入不同的 .log 文件?
  2. 修改日志级别、日志附加程序等而无需重新启动服务器(就像在tomcat中我可以重新部署.war)?

We have Glassfish v2 server and some modules there: EJBs, web-apps, etc...
We need logging from different modules goes to different log files, the same way like Tomcat or other app server allowed to do.

Glassfish forced us to use its own logging system with all logs in single server.log and viewed with admin console.

It may be a good practice for single application deployed with glassfish to have all logs in one file, but not for 10 different apps working on same server

I tried to configure log4j in GF, it helped and I am able to write multiple files, but it had one disadvantage - if log4j installed such way it may allow you to write to multiple log files, but it requeires server/domain restart to modify log level, log file (any log related config in log4 conf)


It is possible to use anything in Glassfish that allowes me to:

  1. Write logs from different loggers to different .log files? and
  2. Modify log levels, log appenders etc without server restart (like in tomcat I can just redeploy the .war)??

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

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

发布评论

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

评论(1

随遇而安 2024-09-19 05:46:56

默认的 Glassfish 日志记录实用程序似乎不允许这样做。

It seems that default Glassfish logging utility does not allow for this.

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