I would like to configure my test log so that the log output is suppressed mainly if the test has not completed. then I would like to get debug output.
I know the manual solution is only to modify log4j.properties in the test path or just debug logging is always active for tests, but I do not want to spam the console with an ill-conceived output for green tests.
In case of unsuccessful tests, I want the automatic build to give me debug output in case of some problems with wiring in the environment.
I thought that there should be an appender that can be combined with a junit rule that suppresses the output until the test result is known, and then only postpones registration in another application if the test does not work.
I could do it myself, but I wonder if anyone has tried this before or if there are better solutions to the problem.
source
share