Using ForgeMod on McMyAdmin 2.7 / AMP pre-1.7

  • 638 Views
  • Last Post 08 September 2018
Mike posted this 16 June 2018

ForgeMod has changed its log output format, and as such MCMA2 no longer recognises it.

Thankfully there's a simple way to change Forge back to its original settings.

Create a file called Log4j.xml and place it alongside your copy of ForgeMod.jar, and insert the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<configuration status="warn" packages="net.minecraftforge.server.terminalconsole.util">
    <appenders>
        <console name="SysOut" target="SYSTEM_OUT">
            <patternlayout>
                <loggernamepatternselector defaultpattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n">
                    <!-- don't include the full logger name for Mojang's logs since they use full class names and it's very verbose -->
                    <patternmatch key="net.minecraft." pattern="[%d{HH:mm:ss}] [%t/%level] : %msg%n"></patternmatch>
                    <patternmatch key="com.mojang." pattern="[%d{HH:mm:ss}] [%t/%level] : %msg%n"></patternmatch>
                </loggernamepatternselector>
            </patternlayout>
        </console>
        <queue name="ServerGuiConsole" ignoreexceptions="true">
            <patternlayout>
                <loggernamepatternselector defaultpattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n">
                    <!-- don't include the full logger name for Mojang's logs since they use full class names and it's very verbose -->
                    <patternmatch key="net.minecraft." pattern="[%d{HH:mm:ss}] [%t/%level] [minecraft/%logger{1}]: %msg%n"></patternmatch>
                    <patternmatch key="com.mojang." pattern="[%d{HH:mm:ss}] [%t/%level] [mojang/%logger{1}]: %msg%n"></patternmatch>
                </loggernamepatternselector>
            </patternlayout>
        </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] [%logger]: %msg%n"></patternlayout>
            <policies>
                <timebasedtriggeringpolicy></timebasedtriggeringpolicy>
                <onstartuptriggeringpolicy></onstartuptriggeringpolicy>
            </policies>
        </rollingrandomaccessfile>
        <rollingrandomaccessfile name="DebugFile" filename="logs/debug.log" filepattern="logs/debug-%i.log.gz">
            <patternlayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n"></patternlayout>
            <policies>
                <onstartuptriggeringpolicy></onstartuptriggeringpolicy>
                <sizebasedtriggeringpolicy size="200MB"></sizebasedtriggeringpolicy>
            </policies>
            <defaultrolloverstrategy max="5" fileindex="min"></defaultrolloverstrategy>
        </rollingrandomaccessfile>
    </appenders>
    <loggers>
        <!-- make sure mojang's logging is set to 'info' so that their LOGGER.isDebugEnabled() behavior isn't active -->
        <logger level="${sys:forge.logging.mojang.level:-info}" name="com.mojang"></logger>
        <logger level="${sys:forge.logging.mojang.level:-info}" name="net.minecraft"></logger>
        <root level="all">
            <filters>
                <markerfilter marker="NETWORK_PACKETS" onmatch="DENY" onmismatch="NEUTRAL"></markerfilter>
            </filters>
            <appenderref ref="SysOut" level="${sys:forge.logging.console.level:-info}"></appenderref>
            <appenderref ref="ServerGuiConsole" level="${sys:forge.logging.console.level:-info}"></appenderref>
            <appenderref ref="File" level="${sys:forge.logging.file.level:-info}"></appenderref>
            <appenderref ref="DebugFile" level="${sys:forge.logging.debugFile.level:-trace}"></appenderref>
        </root>
    </loggers>
</configuration>

You can find a copy of this configuration here: https://pastebin.com/raw/jJZ8dYFA

Then in McMyAdmin.conf, add the following to Java.CustomOpts

-Dlog4j.configurationFile=log4j.xml

This will revert Forge to its original log format and allow it to function correctly.

Order By: Standard | Newest | Votes
taveric posted this 19 July 2018

This was working and then i updated my server and it no longer seems to work. I get this in the console.

2018-07-19 10:37:54,281 main ERROR Error processing element TerminalConsole ([Appenders: null]): CLASSNOTFOUND

2018-07-19 10:37:54,331 main ERROR Unable to locate appender "Console" for logger config "root"

2018-07-19 10:37:54,801 main ERROR Error processing element TerminalConsole ([Appenders: null]): CLASSNOTFOUND

2018-07-19 10:37:54,806 main ERROR Unable to locate appender "Console" for logger config "root"

Mike posted this 08 September 2018

Both McMyAdmin 2 and AMP have been updated and this tweak is no longer required.

https://support.cubecoders.com/thread/mcmyadmin-2-7-1-0-release-notes/

Close