Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 7.4
-
Fix Version/s: 8.1-milestone-2
-
Component/s: Development Issues only - Test
-
Labels:None
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
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