Skip to content

Commit 8e80c18

Browse files
authored
Merge pull request #1215 from kazuki43zoo/gh-1210-upgrade-to-log4j-2.11.0
Supports log4j 2.6+(2.11)
2 parents 8f10084 + 99967dd commit 8e80c18

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
<dependency>
185185
<groupId>org.apache.logging.log4j</groupId>
186186
<artifactId>log4j-core</artifactId>
187-
<version>2.5</version> <!-- 2.6+ occurred a compile error on Log4j2AbstractLoggerImpl (This compile error will resolve on other issue) -->
187+
<version>2.11.0</version>
188188
<optional>true</optional>
189189
</dependency>
190190
<dependency>

src/main/java/org/apache/ibatis/logging/log4j2/Log4j2AbstractLoggerImpl.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2009-2017 the original author or authors.
2+
* Copyright 2009-2018 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.
@@ -20,6 +20,7 @@
2020
import org.apache.logging.log4j.Level;
2121
import org.apache.logging.log4j.Marker;
2222
import org.apache.logging.log4j.MarkerManager;
23+
import org.apache.logging.log4j.message.Message;
2324
import org.apache.logging.log4j.message.SimpleMessage;
2425
import org.apache.logging.log4j.spi.AbstractLogger;
2526
import org.apache.logging.log4j.spi.ExtendedLoggerWrapper;
@@ -51,27 +52,27 @@ public boolean isTraceEnabled() {
5152

5253
@Override
5354
public void error(String s, Throwable e) {
54-
log.logIfEnabled(FQCN, Level.ERROR, MARKER, new SimpleMessage(s), e);
55+
log.logIfEnabled(FQCN, Level.ERROR, MARKER, (Message) new SimpleMessage(s), e);
5556
}
5657

5758
@Override
5859
public void error(String s) {
59-
log.logIfEnabled(FQCN, Level.ERROR, MARKER, new SimpleMessage(s), null);
60+
log.logIfEnabled(FQCN, Level.ERROR, MARKER, (Message) new SimpleMessage(s), null);
6061
}
6162

6263
@Override
6364
public void debug(String s) {
64-
log.logIfEnabled(FQCN, Level.DEBUG, MARKER, new SimpleMessage(s), null);
65+
log.logIfEnabled(FQCN, Level.DEBUG, MARKER, (Message) new SimpleMessage(s), null);
6566
}
6667

6768
@Override
6869
public void trace(String s) {
69-
log.logIfEnabled(FQCN, Level.TRACE, MARKER, new SimpleMessage(s), null);
70+
log.logIfEnabled(FQCN, Level.TRACE, MARKER, (Message) new SimpleMessage(s), null);
7071
}
7172

7273
@Override
7374
public void warn(String s) {
74-
log.logIfEnabled(FQCN, Level.WARN, MARKER, new SimpleMessage(s), null);
75+
log.logIfEnabled(FQCN, Level.WARN, MARKER, (Message) new SimpleMessage(s), null);
7576
}
7677

7778
}

0 commit comments

Comments
 (0)