Details
-
Improvement
-
Resolution: Fixed
-
Major
-
7.4
-
None
-
N/A
-
N/A
-
Description
If you write:
public class AllLogRuleDebugLevelTest { public static final Logger LOGGER = LoggerFactory.getLogger(AllLogRuleDebugLevelTest.class); @Rule public AllLogRule logRule = new AllLogRule(LogLevel.DEBUG); @Test public void staticLogger() { LOGGER.debug("test1"); assertEquals("test1", this.logRule.getMessage(0)); } }
This will fail. The reason is that logback-test.xml is used and the root logger is set to WARN (and since DEBUG < WARN nothing will get logged).
We need AllLogRule to work independently of logback-test.xml