akka/akka — pull request #913 by fommil (2012-12-01 23:47:42+00:00)
Title: java.util.logging support

As discussed on the Akka Users mailing list

https://groups.google.com/d/topic/akka-user/S1bwDHbju94/discussion

the SLF4J backend does not provide the correct information to the `java.util.logging` (j.u.l) backend, since j.u.l does not have an MDC.

Most importantly, the thread of the log message is set to the thread of the Akka logging Actor and the source class/method are set to the Akka logging interface.

This proposed Adapter has two purposes:

1. to allow any Scala class to have access to the same `Logging` API as used by `Actor`s. This is synchronous by default, but can be made asynchronous by providing an `ExecutionContext`.
2. to provide a direct link between the Akka Logging system and the j.u.l. This enables (almost) all `LogRecord` fields to be correctly filled out. Unfortunately, it is not possible to recover the name of the method in which the log was made, as it is apparently not recorded by Akka.

I was unable to `sbt run` the entire Akka source code, due to errors in the cluster package, and I was not able to build and run the tests for `contrib` with sbt – this meant I was unable to use the `AkkaSpec` trait used by many of the packages. Instead, I used Specs2.

It should be a trivial job for somebody who has a build environment that works to change the Spec to work with the internal AkkaSpec instead of Specifications.