Custom log4j2.xml formatting causes Paper to hang with logging/sysout within tab completion from the console

Kahenraz

New member
Sep 25, 2022
1
0
1
I'm not certain whether this is a bug in paper or a problem with how I've formatted my log4j2.xml, but it's done quite simply and I can't see any problem with it. I don't have a problem with custom logging in Spigot, although Paper seems to have made a lot of their own additions to this mechanism, so there is room for regression.

This example file has been pruned down to just the basics to demonstrate the issue.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
         <TerminalConsole name="TerminalConsole">
            <PatternLayout pattern="%msg%n" />
         </TerminalConsole>
    </Appenders>
    <Loggers>
        <Root level="info">
            <AppenderRef ref="TerminalConsole" level="info"/>
        </Root>
    </Loggers>
</Configuration>

This is used in conjunction with tab completion:

Code:
public class TabCompleteExample
   implements TabCompleter
{
   @Override
   public List<String> onTabComplete(
      CommandSender sender,
      Command command,
      String label,
      String[] args)
   {
      Bukkit.getLogger().log(Level.INFO, "onTabComplete");
 
      return null;
   }
}

Everything works fine when tab completing as a player from within a client. But when tab completion is done at the console, the server locks up; I can no longer type anything or press backspace. I can only CTRL-C to bring down the server. I don't have an issue with this using Spigot, just Paper.

I don't know why it's different for Spigot, but the XML tag different between Spigot and Paper. For Spigot, it's "queue" and not "TerminalConsole":

Code:
<Queue name="TerminalConsole">
   <PatternLayout pattern="%msg%n" />
</Queue>

This isn't just an issue with the Bukkit logger. Using System.out.println will cause the hang just the same. Although system.out is already piped though the logging processor, so it's probably the same issue regardless.

Does anyone have any idea why this is causing my server to lockup?
 
Last edited: