Jump to content

venkateshganu

Members
  • Posts

    3
  • Joined

  • Last visited

venkateshganu's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Members 0 2 posts Report post Posted 58 minutes ago 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 GameLogger.java public class GameLogger { public static GameLogger INSTANCE = new GameLogger(); public static final Logger logger = LogManager.getLogger("MyGame"); @SubscribeEvent public synchronized void onPlayerTick(final TickEvent.PlayerTickEvent tick) { if (tick.phase == Phase.END) { if (tick.player.isEntityAlive()) { logger.info("Logger is working"); } } } } log4j2.xml <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" /> <Policies> <TimeBasedTriggeringPolicy /> <OnStartupTriggeringPolicy /> </Policies> </RollingRandomAccessFile> <Logger level="info" name="MyGame" additivity="false"> <AppenderRef ref="StatsFile" /> </Logger> <Root level="all"> <AppenderRef ref="FmlSysOut" level="INFO" /> <AppenderRef ref="ServerGuiConsole" level="INFO" /> <AppenderRef ref="FmlFile"/> </Root> 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.
  2. 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 GameLogger.java public class GameLogger { public static GameLogger INSTANCE = new GameLogger(); public static final Logger logger = LogManager.getLogger("MyGame"); @SubscribeEvent public synchronized void onPlayerTick(final TickEvent.PlayerTickEvent tick) { if (tick.phase == Phase.END) { if (tick.player.isEntityAlive()) { logger.info("Logger is working"); } } } } log4j2.xml <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" /> <Policies> <TimeBasedTriggeringPolicy /> <OnStartupTriggeringPolicy /> </Policies> </RollingRandomAccessFile> <Logger level="info" name="MyGame" additivity="false"> <AppenderRef ref="StatsFile" /> </Logger> <Root level="all"> <AppenderRef ref="FmlSysOut" level="INFO" /> <AppenderRef ref="ServerGuiConsole" level="INFO" /> <AppenderRef ref="FmlFile"/> </Root> 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.
  3. I am unable to find the event or function where if i shift right click items in chest and crafting table it should print the player name and item stack size. This is only working for custom chests and custom crafting tables. Is there a way to override default events and print the needed? Should i use TransferStackinSlot() or slotclick()? Any solution is appreciated!!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.