Smooth Boot (Forge)

Smooth Boot (Forge)

10M Downloads

Amount of logging

Fourmisain opened this issue ยท 2 comments

commented

While it's good to know that the mod is working, the amount of "Initialized {workerName}" is a bit much for INFO level logging.
That should probably be reduced to DEBUG level, or configurable using AutoConfig.

This is also a true debug line:

SmoothBoot.LOGGER.info(executorService2);

commented

I agree that the log level for the initialized messages should be changed to debug. One thing I'm not sure is how to turn on debug logging, because right now I can only see infos and up in the output console.

commented

Logging can be configured via -Dlog4j.configurationFile=

The default configuration for Minecraft is found in the game's version JAR, e.g. under .minecraft\versions\1.16.4\1.16.4.jar, is called log4j2.xml and looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="com.mojang.util">
    <Appenders>
        <Console name="SysOut" target="SYSTEM_OUT">
            <PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
        </Console>
        <Queue name="ServerGuiConsole">
            <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="SysOut"/>
            <AppenderRef ref="File"/>
            <AppenderRef ref="ServerGuiConsole"/>
        </Root>
    </Loggers>
</Configuration>

So if you copy this file to .minecraft and add -Dlog4j.configurationFile=log4j2.xml, you can change the root log level to debug: <Root level="debug">, though I wouldn't recommend that, it's better to change the log level of specific loggers.
You can do that by adding

    <Logger name="smoothboot" level="debug" additivity="false">
      <AppenderRef ref="SysOut"/>
    </Logger>

to the <Loggers> category. additivity="false" means, that the Root settings are not added on top (loggers are called top to bottom).