Status: New
Owner: ----

New issue 636 by [email protected]: Cannot suppress GuiceFilter warning
http://code.google.com/p/google-guice/issues/detail?id=636

I'm attempting to run concurrent unit tests (each one with their own Injector, web server, etc) so I'd like to suppress the warning message emitted by GuiceFilter.setPipeline. setPipeline() invokes: Logger.getLogger(GuiceFilter.class.getName()).warning(MULTIPLE_INJECTORS_WARNING);

java.util.logging.Logger.getLogger() warns "The LogManager may only retain a weak reference to the newly created Logger. It is important to understand that a previously created Logger with the given name may be garbage collected at any time if there is no strong reference to the Logger."

Because GuiceFilter does not retain a strong reference to the Logger, it gets garbage-collected between the time I configure it and the time that GuiceFilter.setPipeline() gets invoked.

Normally the class containing the log is supposed to retain a static reference to the Logger, precisely for this reason. I am configuring the logging level from an xml configuration file. If I am forced to store a strong reference to the Logger on behalf of GuiceFilter it's not entirely clear where I should store such a reference there are multiple unit test files and order of execution is not guaranteed.

Please consider adding a static reference to the Logger.

Also, it's not entirely clear the impact of running concurrent unit tests with GuiceFilter. I see multiple locations GuiceFilter.pipeline is read and written to. Are you *sure* this won't result in threading problems when running multiple servers handling concurrent tests?

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to