在glassfish中安装日志formater [英] Install log formater in glassfish

查看:90
本文介绍了在glassfish中安装日志formater的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不喜欢 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 

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

但我找不到有关如何在Glassfish中安装自定义日志文件的任何信息。有人在这个问题上有一个指针吗?

解决方案

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


  • 实现您的格式化程序

  • 将格式程序的jar放入 DOMAIN_DIR / lib / ext目录

  • < mydomain> /config/logging.properties

中声明它

另见




  • 配置日志


  • I don´t like the output of the com.sun.enterprise.server.logging.UniformLogFormatter which might be uniform but not very helpfull. So in a first step I just replaced it with the java.util.logging.SimpleFormatter. This actualy 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
    

    Beeing a perfectionist I want to get rid of this exeption 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.

    But I could not find any information on how to install a custom log formater into Glassfish. Does anybody have a pointer on this subject?

    解决方案

    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

    这篇关于在glassfish中安装日志formater的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆