Apache log4j2 logger prints to console, not to file when run on server side. The same logger if placed in client side logs to file as expected. This worked fine on 1.7.10 but when transitioned from 1.7.10 to 1.8.9, the logger no longer logs to file but prints to console instead.

the log4j2.xml is placed in the right folder(i.e src\main\resources) and works for other loggers.I don't understand why logger behaves one way in client side and other way in server side.

Anyone facing similar issue for logger from 1.7.10 to 1.8.9? Does this have anything to do with the bus deprecation for event registration. Any help is appreciated


public class GameLogger {

public static GameLogger INSTANCE = new GameLogger();
public static final Logger logger = LogManager.getLogger("MyGame");
public synchronized void onPlayerTick(final TickEvent.PlayerTickEvent tick) {
    if (tick.phase == Phase.END) {
        if (tick.player.isEntityAlive()) {  
                    logger.info("Logger is working");


<RollingRandomAccessFile name="StatsFile" fileName="logs/StatsFile-latest.log" filePattern="logs/StatsFile/%d{yyyy-MM-dd-HH}{GMT}-%i.log.gz">
            <PatternLayout pattern="%d{yyyy/MM/dd HH:mm:ss}{GMT}%msg%n" />
                <TimeBasedTriggeringPolicy />
                <OnStartupTriggeringPolicy />

<Logger level="info" name="MyGame" additivity="false">
            <AppenderRef ref="StatsFile" />
        <Root level="all">
            <AppenderRef ref="FmlSysOut" level="INFO" />
            <AppenderRef ref="ServerGuiConsole" level="INFO" />
            <AppenderRef ref="FmlFile"/>

The logger works fine if i place it in separate client class with client tick logging. It prints to log file as expected, but for some reason does not do the same when placed on server sided class.

  • 1
    You may want to consider asking this question over on Super User as well. Although it's about minecraft server management, the question seems to lean very heavily into just regular ol' system admin work, so folks over there might have a better idea of how to help you.
    – Wipqozn
    Commented Nov 15, 2019 at 0:25
  • Sure Will do. Thank you Wipqozn. Commented Nov 15, 2019 at 0:29

1 Answer 1


Just needed to add


in the vm Arguments.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .