spray/spray — pull request #429 by clementgarnier (2013-08-07 14:23:09+00:00)
Title: = util: fix LoggingAdapter creation to avoid a leak with slf4j back-ends, fixes #421

In order to preserve the logging naming settings, I've wrapped the logSource in a SprayNamedLogSource case class, allowing us to set the name without passing it to Logging as a String. With the provided implicit, the class name is always the one used as the Logger name, even though we keep displaying the right Actor name in the logs. Thus, we cannot create more Logger instances than the number of classes in the application.

After running a 15-hour test on my application, I had about 30 instances of log4j.core.Logger in memory, versus hundreds of millions without this fix.