Switch to log4j2 logging

This commit is contained in:
Andrew Steinborn
2018-07-27 01:54:40 -04:00
parent ae6adf0ca1
commit c9af231c7e
5 changed files with 43 additions and 10 deletions

View File

@@ -12,6 +12,8 @@ import com.velocitypowered.proxy.connection.backend.ServerConnection;
import com.velocitypowered.proxy.data.ServerInfo;
import com.velocitypowered.proxy.util.EncryptionUtils;
import com.velocitypowered.proxy.util.UuidUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.net.InetSocketAddress;
import java.net.URL;
@@ -21,6 +23,8 @@ import java.util.Arrays;
import java.util.concurrent.ThreadLocalRandom;
public class LoginSessionHandler implements MinecraftSessionHandler {
private static final Logger logger = LogManager.getLogger(LoginSessionHandler.class);
private static final String MOJANG_SERVER_AUTH_URL =
"https://sessionserver.mojang.com/session/minecraft/hasJoined?username=%s&serverId=%s&ip=%s";
@@ -71,8 +75,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
handleSuccessfulLogin(profile);
}, inbound.getChannel().eventLoop())
.exceptionally(exception -> {
System.out.println("Can't enable encryption");
exception.printStackTrace();
logger.error("Unable to enable encryption", exception);
inbound.close();
return null;
});