Skip to content

Commit ae15e1d

Browse files
committed
Test for log4J2. Related to #28.
1 parent 6d4800a commit ae15e1d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/java/org/apache/ibatis/logging/LogFactoryTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2012 the original author or authors.
2+
* Copyright 2009-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
2323
import org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl;
2424
import org.apache.ibatis.logging.jdk14.Jdk14LoggingImpl;
2525
import org.apache.ibatis.logging.log4j.Log4jImpl;
26+
import org.apache.ibatis.logging.log4j2.Log4j2Impl;
2627
import org.apache.ibatis.logging.nologging.NoLoggingImpl;
2728
import org.apache.ibatis.logging.slf4j.Slf4jImpl;
2829
import org.apache.ibatis.logging.stdout.StdOutImpl;
@@ -47,6 +48,14 @@ public void shouldUseLog4J() {
4748
assertEquals(log.getClass().getName(), Log4jImpl.class.getName());
4849
}
4950

51+
@Test
52+
public void shouldUseLog4J2() {
53+
LogFactory.useLog4J2Logging();
54+
Log log = LogFactory.getLog(Object.class);
55+
logSomething(log);
56+
assertEquals(log.getClass().getName(), Log4j2Impl.class.getName());
57+
}
58+
5059
@Test
5160
public void shouldUseJdKLogging() {
5261
LogFactory.useJdkLogging();

0 commit comments

Comments
 (0)