add lib apache.logging.log4j.core

This commit is contained in:
MC~蛟龙 2024-07-11 22:05:02 +08:00
parent 2fc75695b8
commit a3667b2763
4 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,7 @@
[versions]
guava = "33.2.1-jre"
apache-commons-email = "1.6.0"
apache-logging-log4j-core = "2.20.0"
configme = "1.3.1"
jalu-injector = "1.0"
adventure-api = "4.17.0"
@ -9,6 +10,7 @@ adventure-platform = "4.3.2"
[libraries]
guava = { module = "com.google.guava:guava", version.ref = "guava" }
apache-commons-email = { module = "org.apache.commons:commons-email", version.ref = "apache-commons-email" }
apache-logging-log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "apache-logging-log4j-core" }
configme = { module = "ch.jalu:configme", version.ref = "configme" }
jalu-injector = { module = "ch.jalu:injector", version.ref = "jalu-injector" }
adventure-text-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure-api" }

View File

@ -42,6 +42,8 @@ subprojects {
compileOnly("org.geysermc.floodgate:api:2.2.2-SNAPSHOT")
// Jalu Injector
implementation(rootProject.libs.jalu.injector)
// Log4J Logger (required by the console filter)
compileOnly(rootProject.libs.apache.logging.log4j.core) // Log4J version bundled in 1.12.2
// MaxMind GEO IP with our modifications to use GSON in replacement of the big Jackson dependency
// GSON is already included and therefore it reduces the file size in comparison to the original version
implementation("com.maxmind.db:maxmind-db-gson:2.0.3") {

View File

@ -2,19 +2,18 @@ package fr.xephi.authme.initialization;
import com.github.Anon8281.universalScheduler.UniversalRunnable;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.logger.ConsoleLogger;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.message.Messages;
import fr.xephi.authme.logger.ConsoleFilter;
import fr.xephi.authme.logger.ConsoleLogger;
import fr.xephi.authme.logger.ConsoleLoggerFactory;
import fr.xephi.authme.logger.Log4JFilter;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.message.Messages;
import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.properties.CommonSettings;
import fr.xephi.authme.settings.properties.DatabaseSettings;
import fr.xephi.authme.settings.properties.EmailSettings;
import fr.xephi.authme.settings.properties.PluginSettings;
import org.apache.logging.log4j.LogManager;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.SimplePie;
@ -50,16 +49,16 @@ public class OnStartupTasks {
/**
* Sends bstats metrics.
*
* @param plugin the plugin instance
* @param plugin the plugin instance
* @param settings the settings
*/
public static void sendMetrics(AuthMe plugin, Settings settings) {
final Metrics metrics = new Metrics(plugin, 18479);
metrics.addCustomChart(new SimplePie("messages_language",
() -> settings.getProperty(CommonSettings.MESSAGES_LANGUAGE)));
() -> settings.getProperty(CommonSettings.MESSAGES_LANGUAGE)));
metrics.addCustomChart(new SimplePie("database_backend",
() -> settings.getProperty(DatabaseSettings.BACKEND).toString()));
() -> settings.getProperty(DatabaseSettings.BACKEND).toString()));
}
/**

View File

@ -2,5 +2,5 @@ dependencies {
compileOnly(project(":project:module-util"))
compileOnly(libs.guava)
// Log4J Logger (required by the console filter)
compileOnly("org.apache.logging.log4j:log4j-core:2.20.0") // Log4J version bundled in 1.12.2
compileOnly(rootProject.libs.apache.logging.log4j.core) // Log4J version bundled in 1.12.2
}