I am trying to configure the logging level of FakeApplication in my Specs2 test cases. However, the override isn't being picked up at all. It seems like it is always loading from logger.xml.
Any thoughts how I can override the logging level for FakeApplication properly?
Clarification: I am not too worry about Specs2 test log, but I am more concern about setting service log level.
Clarification 2: I am setting up it
(integration test) instead of unit test, have a separate folder it/
for it under the main project.
abstract class SmtpServer(
) extends WithServer(
app = FakeApplication(additionalConfiguration = Map(
"logger.root" -> "OFF"
)),
port = 99
)
To configure your logs for testing you must create a logback.xml
file in the test/resources
directory of your project.
@see https://github.com/playframework/playframework/issues/1669#issuecomment-24452132
@see https://www.playframework.com/documentation/2.2.x/SettingsLogger
@see Play Framework 2.2 log output to console in tests
--