在 glassfish 中安装日志格式化程序

发布于 2024-09-26 03:27:13 字数 503 浏览 2 评论 0原文

我不喜欢 com.sun.enterprise.server.logging.UniformLogFormatter 的输出,它可能是统一的,但不是很有帮助。因此,第一步我只是将其替换为 java.util.logging.SimpleFormatter。这实际上工作得很好,但对于 java.lang.ClassCastException 异常:

java.lang.ClassCastException:java.util.logging.SimpleFormatter 无法转换为 com.sun.enterprise.server.logging.UniformLogFormatter

作为一个完美主义者,我想摆脱这个异常,我想知道是否可以创建自己的子类来自 com.sun.enterprise.server.logging.UniformLogFormatter 并以某种方式将此类安装到 glassfish 中。

如何在 Glassfish 中安装自定义日志格式化程序?

I don´t like the output of the com.sun.enterprise.server.logging.UniformLogFormatter which might be uniform but not very helpful. So in a first step I just replaced it with the java.util.logging.SimpleFormatter. This actually works fine but for a java.lang.ClassCastException exception:

java.lang.ClassCastException: java.util.logging.SimpleFormatter cannot be cast to com.sun.enterprise.server.logging.UniformLogFormatter

Being a perfectionist I want to get rid of this exception and I wonder if I can create my own child class from com.sun.enterprise.server.logging.UniformLogFormatter and somehow install this class into glassfish.

How to install a custom log formatter into Glassfish?

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

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

发布评论

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

评论(1

仅冇旳回忆 2024-10-03 03:27:13

查看 GlassFish 论坛上的配置服务器日志格式。基本上,您需要:

  • 实现格式化程序
  • 将带有格式化程序的 jar 放在 domain_dir/lib/ext 中。
  • /config/logging.properties 中声明它

另请参阅

Have a look at Configuring format of server log on the GlassFish forums. Basically, you need to:

  • Implement your formatter
  • Put the jar with your formatter in domain_dir/lib/ext.
  • Declare it in <mydomain>/config/logging.properties

See also

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