Unable to get any registration result in unit tests in Play 2.3 using Logger.error("an error") . I tried all these examples that seem to be out of date.
The closest I got with build.sbt containing the following:
testOptions in Test += Tests.Argument("-Dlogger.resource=conf/test-logger.xml")
This causes the test-logger.xml configure the logger, but I still don't get any results.
Has anyone had success with this in Play 2.3?
Workaround Workaround
I am currently using the quick-use class to handle this until it is fixed. Added here as it may be useful for someone else.
public class Logger { public static void debug(String message) { System.out.println(String.format("[debug] %s", message)); } public static void info(String message) { System.out.println(String.format("[info] %s", message)); } public static void warn(String message) { System.out.println(String.format("[warn] %s", message)); } public static void error(String message) { System.err.println(String.format("[error] %s", message)); } }
source share