无法获得繁琐的日志记录,我的log4j日志文件未写入任何内容 [英] can not get grizzly logging to work, nothing written to my log4j log file

查看:251
本文介绍了无法获得繁琐的日志记录,我的log4j日志文件未写入任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Java/Spring程序,使用标准的log4j.properties文件控制日志记录,效果很好.当我们通过以下方式添加Grizzly时:

I have a simple Java/Spring program using a standard log4j.properties file to control logging, which is working fine. When we added Grizzly via:

GrizzlyHttpServerFactory.createHttpServer(uri,resourceConfig)

GrizzlyHttpServerFactory.createHttpServer(uri, resourceConfig)

一切正常(也就是说,服务器实际上可以使用...但是我没有日志输出.

things work (i.e. the server in fact serves...but I get no log output.

我在log4j.properties中有一个明确的条目,用于"org.glassfish.grizzly".

I have an explicit entry in log4j.properties for "org.glassfish.grizzly".

我已经调试了Grizzly的ExtendedLogger类,并且可以看到它已经接近日志记录了,但是现在还没有.

I've gone so far as to debug into Grizzly's ExtendedLogger class and can see that its getting close to logging but then doesn't.

推荐答案

原来,Grizzly使用基于java.util.logging而不是log4j或slf4j的自己的日志记录,这意味着您需要一个单独的日志记录配置文件.有关使用它的很好描述,请参见: http://www.javapractices.com/topic/TopicAction.do?Id = 143

Turns out Grizzly uses its own logging based on java.util.logging rather than than log4j or slf4j which means you need a separate logging configuration file. A good description of using that is at: http://www.javapractices.com/topic/TopicAction.do?Id=143

这篇关于无法获得繁琐的日志记录,我的log4j日志文件未写入任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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