2020-05-08 20:40:13 +02:00
|
|
|
From bc19d3966f696f76fe17a68f4bd2ce1a4de66a96 Mon Sep 17 00:00:00 2001
|
2018-07-06 23:00:08 +02:00
|
|
|
From: Minecrell <minecrell@minecrell.net>
|
2017-09-22 13:07:59 +02:00
|
|
|
Date: Fri, 22 Sep 2017 13:07:31 +0200
|
|
|
|
Subject: [PATCH] Handle plugin prefixes using Log4J
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java b/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java
|
2020-03-07 23:50:46 +01:00
|
|
|
index 2286a1ab..9660234d 100644
|
2017-09-22 13:07:59 +02:00
|
|
|
--- a/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java
|
|
|
|
+++ b/api/src/main/java/net/md_5/bungee/api/plugin/Plugin.java
|
2020-03-07 23:50:46 +01:00
|
|
|
@@ -102,7 +102,7 @@ public class Plugin
|
2017-09-22 13:07:59 +02:00
|
|
|
this.proxy = proxy;
|
|
|
|
this.description = description;
|
|
|
|
this.file = description.getFile();
|
|
|
|
- this.logger = new PluginLogger( this );
|
|
|
|
+ this.logger = Logger.getLogger(description.getName()); // Waterfall - Handle plugin prefixes in implementation
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
diff --git a/log4j/src/main/resources/log4j2.xml b/log4j/src/main/resources/log4j2.xml
|
2018-07-18 19:46:20 +02:00
|
|
|
index 93ce3b14..3b3525f0 100644
|
2017-09-22 13:07:59 +02:00
|
|
|
--- a/log4j/src/main/resources/log4j2.xml
|
|
|
|
+++ b/log4j/src/main/resources/log4j2.xml
|
|
|
|
@@ -2,10 +2,20 @@
|
|
|
|
<Configuration status="warn">
|
|
|
|
<Appenders>
|
|
|
|
<TerminalConsole name="TerminalConsole">
|
|
|
|
- <PatternLayout pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
|
|
|
+ <PatternLayout>
|
|
|
|
+ <LoggerNamePatternSelector defaultPattern="%highlightError{[%d{HH:mm:ss} %level] [%logger]: %minecraftFormatting{%msg}%n%xEx}">
|
|
|
|
+ <!-- Log root and BungeeCord loggers without prefix -->
|
|
|
|
+ <PatternMatch key=",BungeeCord" pattern="%highlightError{[%d{HH:mm:ss} %level]: %minecraftFormatting{%msg}%n%xEx}" />
|
|
|
|
+ </LoggerNamePatternSelector>
|
|
|
|
+ </PatternLayout>
|
|
|
|
</TerminalConsole>
|
|
|
|
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz" immediateFlush="false">
|
|
|
|
- <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
|
|
|
+ <PatternLayout>
|
|
|
|
+ <LoggerNamePatternSelector defaultPattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %minecraftFormatting{%msg}{strip}%n">
|
|
|
|
+ <!-- Log root and BungeeCord loggers without prefix -->
|
|
|
|
+ <PatternMatch key=",BungeeCord" pattern="[%d{HH:mm:ss}] [%t/%level]: %minecraftFormatting{%msg}{strip}%n" />
|
|
|
|
+ </LoggerNamePatternSelector>
|
|
|
|
+ </PatternLayout>
|
|
|
|
<Policies>
|
|
|
|
<TimeBasedTriggeringPolicy />
|
|
|
|
<OnStartupTriggeringPolicy />
|
|
|
|
--
|
2020-05-08 20:40:13 +02:00
|
|
|
2.26.1
|
2017-09-22 13:07:59 +02:00
|
|
|
|