From 8b9f0ec88254107b10cb57bb2fc5939516921985 Mon Sep 17 00:00:00 2001 From: Xephi59 Date: Fri, 31 Jul 2015 14:22:07 +0200 Subject: [PATCH] Custom name to pool --- src/main/java/fr/xephi/authme/AuthMe.java | 9 +++++---- src/main/java/fr/xephi/authme/datasource/MySQL.java | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 99cea4a07..98f335d4b 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -166,10 +166,11 @@ public class AuthMe extends JavaPlugin { // Set Console Filter if (Settings.removePassword) { - this.getLogger().setFilter(new ConsoleFilter()); - Bukkit.getLogger().setFilter(new ConsoleFilter()); - Logger.getLogger("Minecraft").setFilter(new ConsoleFilter()); - authmeLogger.setFilter(new ConsoleFilter()); + ConsoleFilter filter = new ConsoleFilter(); + this.getLogger().setFilter(filter); + Bukkit.getLogger().setFilter(filter); + Logger.getLogger("Minecraft").setFilter(filter); + authmeLogger.setFilter(filter); // Set Log4J Filter try { Class.forName("org.apache.logging.log4j.core.Filter"); diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index 7ae8b6d5d..43433be9d 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -105,6 +105,7 @@ public class MySQL implements DataSource { config.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database); config.setUsername(this.username); config.setPassword(this.password); + config.setPoolName("AuthMeMYSQLPool"); config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); @@ -900,6 +901,7 @@ public class MySQL implements DataSource { config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.addDataSourceProperty("autoReconnect", true); config.addDataSourceProperty("initializationFailFast", true); + config.setPoolName("AuthMeMYSQLPool"); ds = new HikariDataSource(config); if (!reload) ConsoleLogger.info("ConnectionPool was unavailable... Reconnected!");