Jump to content

cryxli

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by cryxli

  1. I may have found a way to "enable" logging the way we are used to. Please, verify my train of thoughts: [*]Fact: I'm using eclipse. [*]Fact: Forge uses log4j2 [*]Fact: log4j2 is configured using properties/XML files. If missing log4j(2) will log an error right at the beginning. No error observed, log4j must be configured somewhere. [*]Fact: The lib forgeSrc-<version>.jar contains a log4j2.xml [*]Action: Copy this file to the root directory of the project. Question: Which directory is the root? [*]Observation: When starting the client using the eclipse launcher, a directory structure just like the one known from a normal forge installation is created within the "eclipse" dir. [*]Action: Putting log4j2.xml into eclipse dir. [*]Action: Verify which logger my mod gets in the pre-init phase. FMLPreInitializationEvent event; event.getModLog().getName() Is seems to be one named like my MOD-ID. [*]Action: Adding a logger for my mod to my log4j2.xml <Loggers> [...] <Logger level="debug" name="myModId"> <AppenderRef ref="FmlSysOut" /> </Logger> </Loggers> (Not yet investigated what the 5 defined appenders do.) [*]Action: Start client. Observation: I'm still logging INFO. [*]Action: Force log4j2 to load my file by adding a VM argument to the launcher config next to the memory size: -Xincgc -Xmx1024M -Xms1024M -Dlog4j.configurationFile=log4j2.xml [*]Action: Start client. Observation: I'm logging DEBUG. My idea is to have the dev env configured to log the way I want and not having to change my code or alter libs. Therefore, tweaking the launcher config and copying the logging config is acceptable, I think.
  2. How to get logs: I assume you're running SPS. Good news: MC does write logs by itself. You do not need to do anything special. The bad news: You have to find the correct log file: In the minecraft directory (by default the .minecraft, I do not know mac and cannot tell you where this is stored. Try the minecraft launcher -> edit launch config...) there are two other dirs logs crash-reports Look at the timestamp of the log files (when the file was last modified that is) in there and try to select the one that is most likely to cover the time of your freezes. If you're lucky MC even created a crash report. They have the timestamp in the file name. Good luck!
×
×
  • Create New...

Important Information

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