在 glassfish 中安装日志格式化程序
我不喜欢 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 GlassFish 论坛上的配置服务器日志格式。基本上,您需要:
domain_dir/lib/ext
中。/config/logging.properties
中声明它另请参阅
Have a look at Configuring format of server log on the GlassFish forums. Basically, you need to:
domain_dir/lib/ext
.<mydomain>/config/logging.properties
See also