问题
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