can not get grizzly logging to work, nothing written to my log4j log file

随声附和 提交于 2019-12-23 15:29:44

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/12370984/can-not-get-grizzly-logging-to-work-nothing-written-to-my-log4j-log-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!