update log4j 1.2.17 -> log4j 2.11.2

(log4j 2.12.x latest needs higher Android API)
This commit is contained in:
Anthony Calosa
2019-11-02 10:07:13 +08:00
parent 446fb59473
commit 001a1981cf
6 changed files with 38 additions and 15 deletions

View File

@@ -32,8 +32,8 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.sentry</groupId> <groupId>io.sentry</groupId>
<artifactId>sentry-log4j</artifactId> <artifactId>sentry-log4j2</artifactId>
<version>1.7.5</version> <version>1.7.27</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -27,6 +27,8 @@
-dontwarn java.lang.** -dontwarn java.lang.**
-dontwarn org.slf4j.** -dontwarn org.slf4j.**
-dontwarn javax.** -dontwarn javax.**
-dontwarn org.apache.logging.log4j.**
-dontwarn module-info
# mandatory proguard rules for cache2k to keep the core implementation # mandatory proguard rules for cache2k to keep the core implementation
-dontwarn org.cache2k.impl.xmlConfiguration.** -dontwarn org.cache2k.impl.xmlConfiguration.**

View File

@@ -168,9 +168,14 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-api</artifactId>
<version>1.2.17</version> <version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode</groupId> <groupId>com.googlecode</groupId>

View File

@@ -58,9 +58,14 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-api</artifactId>
<version>1.2.17</version> <version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.fourthline.cling</groupId> <groupId>org.fourthline.cling</groupId>

View File

@@ -14,7 +14,6 @@ import forge.net.event.LogoutEvent;
import forge.net.event.MessageEvent; import forge.net.event.MessageEvent;
import forge.net.event.NetEvent; import forge.net.event.NetEvent;
import forge.net.event.UpdateLobbyPlayerEvent; import forge.net.event.UpdateLobbyPlayerEvent;
import forge.properties.ForgeConstants;
import io.netty.bootstrap.ServerBootstrap; import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFuture;
@@ -39,9 +38,6 @@ import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Map; import java.util.Map;
import org.apache.log4j.PropertyConfigurator;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.Log4JLoggerFactory;
import org.fourthline.cling.UpnpService; import org.fourthline.cling.UpnpService;
import org.fourthline.cling.UpnpServiceImpl; import org.fourthline.cling.UpnpServiceImpl;
import org.fourthline.cling.support.igd.PortMappingListener; import org.fourthline.cling.support.igd.PortMappingListener;
@@ -87,8 +83,6 @@ public final class FServerManager {
*/ */
public static FServerManager getInstance() { public static FServerManager getInstance() {
if (instance == null) { if (instance == null) {
if(GuiBase.hasPropertyConfig())
PropertyConfigurator.configure(ForgeConstants.ASSETS_DIR + "/src/main/resources/log4jConfig.config");
instance = new FServerManager(); instance = new FServerManager();
} }
return instance; return instance;
@@ -96,7 +90,6 @@ public final class FServerManager {
public void startServer(final int port) { public void startServer(final int port) {
try { try {
InternalLoggerFactory.setDefaultFactory(Log4JLoggerFactory.INSTANCE);
final ServerBootstrap b = new ServerBootstrap() final ServerBootstrap b = new ServerBootstrap()
.group(bossGroup, workerGroup) .group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class) .channel(NioServerSocketChannel.class)

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="ALL">
<Appenders>
<Console name="A1">
<PatternLayout pattern="%-4r [%t] %-5p %c %x - %m%n" />
</Console>
<!--Sentry name="Sentry" /-->
</Appenders>
<Loggers>
<Root level="ALL">
<AppenderRef ref="A1" />
<!-- Note that the Sentry logging threshold is overridden to the WARN level -->
<!--AppenderRef ref="Sentry" level="WARN" /-->
</Root>
</Loggers>
</Configuration>