Open wsargent opened 8 years ago
2.5.x
Scala
From https://groups.google.com/d/topic/play-framework/daAbQ3nHfjc/discussion
Documentation suggests using Server.withRouter() to test web service clients.
Server.withRouter()
https://www.playframework.com/documentation/2.5.1/ScalaTestingWebServiceClients
This has unintended consequence of shutting down logging after the test. Subsequent logs do not appear on the console.
https://github.com/playframework/playframework/blob/440be28c9598d4ff0957cda1367803f95f4c50a0/framework/src/play-server/src/main/scala/play/core/server/Server.scala#L71-L75
I have minimal repo that demonstrates the issue here
https://github.com/jsw/play-2.5-logging-test
There is a work around by using a LoggerConfigurator that does nothing on shutdown:
https://gist.github.com/thetristan/dba8c5f6699c9d18b146e8c10d81a6f1
Thanks @wsargent & github user thetristan for the work-around. I put the two files from here into my test/resources directory and now all tests produce proper logging.
test/resources
Play Version (2.5.x / etc)
2.5.x
API (Scala / Java / Neither / Both)
Scala
Actual Behavior
From https://groups.google.com/d/topic/play-framework/daAbQ3nHfjc/discussion
Documentation suggests using
Server.withRouter()
to test web service clients.https://www.playframework.com/documentation/2.5.1/ScalaTestingWebServiceClients
This has unintended consequence of shutting down logging after the test. Subsequent logs do not appear on the console.
https://github.com/playframework/playframework/blob/440be28c9598d4ff0957cda1367803f95f4c50a0/framework/src/play-server/src/main/scala/play/core/server/Server.scala#L71-L75
I have minimal repo that demonstrates the issue here
https://github.com/jsw/play-2.5-logging-test
There is a work around by using a LoggerConfigurator that does nothing on shutdown:
https://gist.github.com/thetristan/dba8c5f6699c9d18b146e8c10d81a6f1