Log Levels and Debug Logging - Arim-Minecraft/NetPaper GitHub Wiki
Internally, Minecraft uses the log4j2 library for logging. Log messages are shown depending on the logging level configured. Logging levels allow fine-grained control over the volume of log content in the server console.
If the logging level is higher than the level used to log the message, then the message won't be shown. The levels are:
ALLTRACEDEBUGINFOWARNERRORFATALOFF
If you set the global logging level to OFF, you won't receive any log messages. If you set it to ALL, you will receive all log messages. The default is INFO, meaning you will only see messages logged at the FATAL, ERROR, WARN, and INFO levels.
Spigot's debug option in the spigot.yml does not actually have an effect. For full debug logging, you need to use a log4j2.xml file and change the logging level.
This is the default config for log4j2 shipped with Minecraft. As you can see, it says Root level="info" which means that only log messages of at least INFO importance are detailed. This default file is NOT generated in your server's directory. Rather, it is contained within the server jar.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
<Appenders>
<Console name="WINDOWS_COMPAT" target="SYSTEM_OUT"></Console>
<Queue name="TerminalConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
</Policies>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="WINDOWS_COMPAT" level="info"/>
<AppenderRef ref="File"/>
<AppenderRef ref="TerminalConsole" level="info"/>
</Root>
</Loggers>
</Configuration>To change the logging level, copy the default config and make a new file in your server's directory. Call it log4j2.xml. Carefully edit these parts:
<Root level="info"><AppenderRef ref="WINDOWS_COMPAT" level="info"/><AppenderRef ref="TerminalConsole" level="info"/>
Change 'info' to whichever log level you want. For example, if you want all log messages, change it to 'all'.
Then, you need to use the system property log4j.configurationFile to specify your own file. Add startup flag -Dlog4j.configurationFile=log4j2.xml to do this.
For example, this might be your old/new start-up command.
- Old:
java -Xmx8192M -jar NetPaper.jar - New:
java -Xmx8192M -Dlog4j.configurationFile=log4j2.xml -jar NetPaper.jar