不能让grizzly日志工作,没有任何东西写入我的log4j日志文件中。[英] can not get grizzly logging to work, nothing written to my log4j log file

本文是小编为大家收集整理的关于不能让grizzly日志工作,没有任何东西写入我的log4j日志文件中。的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我使用标准log4j.properties文件来控制日志记录,有一个简单的Java/spring程序,该文件正常.当我们通过以下方式添加灰熊时:

grizzlyhttpserfactory.createhttpserver(uri,resourceconfig)

事情有效(即服务器实际上服务...但是我没有日志输出.

我在log4j.properties中有一个明确的条目.

我甚至还要调试Grizzly的ExtendedLogger课程,并且可以看到它接近伐木,但没有.

推荐答案

事实证明,灰色使用自己的日志记录基于java.util.logging而不是log4j或slf4j,这意味着您需要一个单独的记录配置文件.使用的良好描述是: http://www.javapractices.com/主题/主题action.do?id = 143

本文地址:https://www.itbaoku.cn/post/1575012.html

问题描述

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)

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

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

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.

推荐答案

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