Activating logging in test mode in Play 2.0.x

Published on 26 October 2012

Because of a permgen leak related to third-party libraries, the logging in test mode is disabled in Play 2.0.x (there’s a fix coming up in Play 2.1). In some cases, seeing what happens while running a test can be useful – e.g. when debugging calls to various Akka actors that don’t quite behave as expected.

Luckily there’s a workaround, which is to specify a logger for logback by hand when starting play or SBT:

play -Dlogger.resource=test-logger.xml

does the trick.

Liked this article? Subscribe to the mailing list to get updates on similar topics.

Leave a Reply