在Glassfish中安装日志格式化程序 [英] Install log formatter in glassfish
问题描述
我不喜欢com.sun.enterprise.server.logging.UniformLogFormatter
的输出,该输出可能是统一的,但不是很有帮助.因此,在第一步中,我只是将其替换为java.util.logging.SimpleFormatter
.这实际上可以正常工作,但是对于java.lang.ClassCastException
例外:
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强制转换为com.sun.enterprise.server.logging.UniformLogFormatter
java.lang.ClassCastException: java.util.logging.SimpleFormatter cannot be cast to com.sun.enterprise.server.logging.UniformLogFormatter
作为一个完美主义者,我想摆脱这种例外情况,我想知道是否可以从com.sun.enterprise.server.logging.UniformLogFormatter创建自己的子类,并以某种方式将该类安装到glassfish中.
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.
如何在Glassfish中安装自定义日志格式化程序?
How to install a custom log formatter into Glassfish?
推荐答案
看看配置服务器格式在GlassFish论坛上登录.基本上,您需要:
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
中声明
- Implement your formatter
- Put the jar with your formatter in
domain_dir/lib/ext
. - Declare it in
<mydomain>/config/logging.properties
这篇关于在Glassfish中安装日志格式化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!