#3374, #3389: Improve log handling of normal java.util Logger usage by forwarding the LogRecords directly to the BungeeLogger instead of the fallback err stream.

This commit is contained in:
floge07
2022-11-12 11:51:14 +11:00
committed by md_5
parent bf2b3c68f8
commit c3e8cfac79
3 changed files with 46 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ public class BungeeLogger extends Logger
{
super( loggerName, null );
setLevel( Level.ALL );
setUseParentHandlers( false );
try
{

View File

@@ -0,0 +1,29 @@
package net.md_5.bungee.log;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public class LoggingForwardHandler extends Handler
{
private final Logger logger;
@Override
public void publish(LogRecord record)
{
logger.log( record );
}
@Override
public void flush()
{
}
@Override
public void close() throws SecurityException
{
}
}