L2JLisvus

Would you like to react to this message? Create an account in a few clicks or log in to continue.

4 posters

    [Share] "Modern" Console log format

    jmd
    jmd


    Posts : 56
    Join date : 2013-03-07
    Age : 32
    Location : Greece

    [Share] "Modern" Console log format Empty [Share] "Modern" Console log format

    Post  jmd 28th May 2021, 18:29

    Just a quality of life thing, so we know exactly when something happened.

    https://gist.github.com/JMD13/5654418b25a4bb86f3d863a419c74339

    [Share] "Modern" Console log format Modern10

    henrique and legionarios like this post

    legionarios
    legionarios


    Posts : 42
    Join date : 2016-06-17
    Age : 42
    Location : san luis

    [Share] "Modern" Console log format Empty Re: [Share] "Modern" Console log format

    Post  legionarios 7th January 2022, 05:12

    jmd wrote:Just a quality of life thing, so we know exactly when something happened.

    https://gist.github.com/JMD13/5654418b25a4bb86f3d863a419c74339

    [Share] "Modern" Console log format Modern10

    perdon por mi ignorancia pero para que serviria ese registro moderno?
    avatar
    fissban


    Posts : 83
    Join date : 2013-12-10

    [Share] "Modern" Console log format Empty Re: [Share] "Modern" Console log format

    Post  fissban 5th March 2022, 18:09

    Desconozco como se veia antes, pero cualquier mejora en los mensajes de la consola es bien recibido.
    Sirve para que puedas apreciar mejor el estado de tu servidor
    henrique
    henrique


    Posts : 26
    Join date : 2013-08-20

    [Share] "Modern" Console log format Empty Re: [Share] "Modern" Console log format

    Post  henrique 1st September 2022, 00:23

    Here is my contribution to improving the console view.

    Code:

    diff --git a/core/java/net/sf/l2j/gameserver/GameServer.java b/core/java/net/sf/l2j/gameserver/GameServer.java
    index ca8ce8dba74a278770bc11cb8e8ea75a1e38e6b3..53fd4cd223472c9316522d389982984cedaac14f 100644
    --- a/core/java/net/sf/l2j/gameserver/GameServer.java
    +++ b/core/java/net/sf/l2j/gameserver/GameServer.java
    @@ -109,6 +109,7 @@ import net.sf.l2j.mmocore.SelectorThread;
     import net.sf.l2j.status.Status;
     import net.sf.l2j.util.DeadLockDetector;
     import net.sf.l2j.util.IPv4Filter;
    +import net.sf.l2j.util.StringUtil;
     import net.sf.l2j.util.UPnPService;
     
     /**
    @@ -156,156 +157,143 @@ public class GameServer {
           _gameServer = this;
           _log.finest("used mem:" + getUsedMemoryMB() + "MB");
     
    +      StringUtil.printSection("Lisvus");
           if (Config.PROJECT_COMMIT_ID != null) {
              _log.info("L2JLisvus commit: " + Config.PROJECT_COMMIT_ID);
           }
    -
    +      
    +      StringUtil.printSection("IdFactory");
           IdFactory.getInstance();
           ThreadPoolManager.getInstance();
     
           new File(Config.DATAPACK_ROOT, "data/crests").mkdirs();
           new File("log/game").mkdirs();
     
    -      // Load script engines
    -      L2ScriptEngineManager.getInstance();
    -
    -      // Initialize game time controller
    -      GameTimeController.getInstance();
    -
    -      // NPC and AIO Buffs
    -      BufferTable.getInstance();
    -
    -      CharTemplateTable.getInstance();
    +      StringUtil.printSection("World");
    +      L2World.getInstance();
    +      MapRegionTable.getInstance();
    +      Announcements.getInstance();
    +      
    +      StringUtil.printSection("Skills");
           SkillTreeTable.getInstance();
           SkillTable.getInstance();
    -
    +      NobleSkillTable.getInstance();
    +      
    +      StringUtil.printSection("Items");
           ItemTable.getInstance();
           ExtractableItemsData.getInstance();
           SummonItemsData.getInstance();
    -
    -      TradeController.getInstance();
    -      L2Multisell.getInstance();
    -
    -      // L2EMU_ADD by Rayan. L2J - BigBro
    -      if (Config.ALLOW_NPC_WALKERS) {
    -         NpcWalkerRoutesTable.getInstance();
    -      }
    -
    +      HennaTable.getInstance();
    +      HennaTreeTable.getInstance();
    +      SoulCrystalData.getInstance();
           RecipeController.getInstance();
    -
           ArmorSetsTable.getInstance();
           FishTable.getInstance();
    -
    -      if (Config.SP_BOOK_NEEDED) {
    +      TradeController.getInstance();
    +      L2Multisell.getInstance();
    +      if (Config.SP_BOOK_NEEDED)
              SkillSpellbookTable.getInstance();
    -      }
    +      
    +      StringUtil.printSection("Admins");
    +      AdminCommandRightsData.getInstance();
    +      PetitionManager.getInstance();
     
    +      StringUtil.printSection("Characters");
    +      CharTemplateTable.getInstance();
           CharNameTable.getInstance();
    -      NobleSkillTable.getInstance();
    -
    -      // Call to load caches
           HtmCache.getInstance();
    -      CrestCache.getInstance();
    -
    -      // forum has to be loaded before clan data, because of last forum id used should
    -      // have also memo included
    -      if (Config.COMMUNITY_TYPE > 0) {
    +      TeleportLocationTable.getInstance();
    +      // Load pet data from db
    +      PetDataTable.getInstance().loadPetData();
    +      MercTicketManager.getInstance();
    +      PartyMatchRoomList.getInstance();
    +      
    +      StringUtil.printSection("Community server");
    +      // forum has to be loaded before clan data
    +      if (Config.COMMUNITY_TYPE > 0)
              ForumsBBSManager.getInstance().initRoot();
    -      }
    -
    +      else
    +         _log.info("Community server is disabled.");
    +      
    +      StringUtil.printSection("Clans");
    +      CrestCache.getInstance();
           ClanTable.getInstance();
    -
    +      ClanHallManager.getInstance();
    +      AuctionManager.getInstance();
    +      
    +      StringUtil.printSection("Geodata & Pathfinding");
           GeoData.getInstance();
    -      if (Config.PATHFINDING > 0) {
    +      if (Config.PATHFINDING > 0)
              PathFinding.getInstance();
    -      }
    -
    -      NpcTable.getInstance();
    -
    -      HennaTable.getInstance();
    -      HennaTreeTable.getInstance();
    -      SoulCrystalData.getInstance();
    -      HelperBuffTable.getInstance();
    -
    -      L2World.getInstance();
    -
    -      Announcements.getInstance();
    -
    -      // Load clan hall data before zone data
    -      ClanHallManager.getInstance();
    +      
    +      StringUtil.printSection("Zones");
    +      ZoneManager.getInstance();
    +      
    +      StringUtil.printSection("Castles");
           CastleManager.getInstance();
    +      CastleManager.getInstance().loadDoorUpgrades();
           SiegeManager.getInstance().initializeCastleSieges();
    +      
    +      StringUtil.printSection("Task Managers");
    +      TaskManager.getInstance();
    +      AutoAnnounceTaskManager.getInstance();
    +      
    +      StringUtil.printSection("Seven Signs");
    +      SevenSigns.getInstance();
    +      SevenSignsFestival.getInstance();
    +      SevenSigns.getInstance().spawnSevenSignsNPC();
     
    -      TeleportLocationTable.getInstance();
    +      StringUtil.printSection("Manor Manager");
    +      CastleManorManager.getInstance();
    +      L2Manor.getInstance();
    +      
    +      StringUtil.printSection("NPCs");
    +      NpcTable.getInstance();
    +      DoorTable.getInstance();
    +      BufferTable.getInstance();
    +      HelperBuffTable.getInstance();
           GrandBossManager.getInstance();
    -
    -      // Zone Data
    -      ZoneManager.getInstance();
           GrandBossManager.getInstance().initZones();
    -
    -      // Spawn Data
           DayNightSpawnManager.getInstance();
    +      StaticObjects.getInstance();
           SpawnTable.getInstance();
           RaidBossSpawnManager.getInstance();
           DayNightSpawnManager.getInstance().notifyChangeMode();
           DimensionalRiftManager.getInstance();
    -      FourSepulchersManager.getInstance().init();
    -
    -      // Start game time controller task
    -      GameTimeController.getInstance().start();
    -
    -      MapRegionTable.getInstance();
    -      EventDroplist.getInstance();
    -
    -      /** Load Manor Data */
    -      L2Manor.getInstance();
    -
    -      AuctionManager.getInstance();
    -
    -      Lottery.getInstance();
    -
    -      BoatManager.getInstance();
    -      CastleManorManager.getInstance();
    -
    -      MercTicketManager.getInstance();
    -      PartyMatchRoomList.getInstance();
    -      PetitionManager.getInstance();
    -      QuestManager.getInstance();
    +      if (Config.ALLOW_NPC_WALKERS)
    +         NpcWalkerRoutesTable.getInstance();
     
    +      StringUtil.printSection("Olympiads & Heroes");
    +      Olympiad.getInstance();
    +      Hero.getInstance();
    +      
    +      StringUtil.printSection("Four Sepulchers");
    +      FourSepulchersManager.getInstance().init();
    +      
    +      StringUtil.printSection("Quests & Scripts");
    +      L2ScriptEngineManager.getInstance();
           _log.info("Loading Server Scripts");
           File scripts = new File(Config.DATAPACK_ROOT + "/data/scripts.cfg");
           L2ScriptEngineManager.getInstance().executeScriptList(scripts);
    -
    +      QuestManager.getInstance();
           QuestManager.getInstance().report();
    -
    -      if (Config.SAVE_DROPPED_ITEM) {
    -         ItemsOnGroundManager.getInstance();
    -      }
    -
    -      if (Config.AUTODESTROY_ITEM_AFTER > 0) {
    -         ItemsAutoDestroy.getInstance();
    -      }
    -
    -      MonsterRace.getInstance();
    -
    -      DoorTable.getInstance();
    -      CastleManager.getInstance().loadDoorUpgrades();
    -
    -      StaticObjects.getInstance();
    -
    -      SevenSigns.getInstance();
    -      SevenSignsFestival.getInstance();
    -      AutoSpawnHandler.getInstance();
    -      AutoChatHandler.getInstance();
    -
    -      // Spawn the Orators/Preachers if in the Seal Validation period.
    -      SevenSigns.getInstance().spawnSevenSignsNPC();
    -
    -      Olympiad.getInstance();
    -      Hero.getInstance();
    -
    +      BoatManager.getInstance();
           FaenorScriptEngine.getInstance();
    +      
    +      StringUtil.printSection("Events");
    +      EventDroplist.getInstance();
    +      // Initialize Event Engine
    +      EventEngine.getInstance();
    +      // Wedding system
    +      CoupleManager.getInstance();
    +      
    +      if (Config.ALLOW_AUTO_REWARDER)
    +         AutoRewarder.load();
    +         
    +      Lottery.getInstance();
    +      MonsterRace.getInstance();
     
    +      StringUtil.printSection("Handlers");
           _log.config("AutoSpawnHandler: Loaded " + AutoSpawnHandler.getInstance().size() + " handlers in total.");
           _log.config("AutoChatHandler: Loaded " + AutoChatHandler.getInstance().size() + " handlers in total.");
     
    @@ -315,18 +303,38 @@ public class GameServer {
           AdminCommandHandler.getInstance().load();
           UserCommandHandler.getInstance().load();
           VoicedCommandHandler.getInstance().load();
    +      AutoSpawnHandler.getInstance();
    +      AutoChatHandler.getInstance();
    +      
    +      StringUtil.printSection("Offline Trader");
    +      if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS) {
    +         OfflineTradersTable.restoreOfflineTraders();
    +      }
    +      else
    +         _log.info("System deactived.");
    +
    +      StringUtil.printSection("System");
    +      // Initialize game time controller
    +      GameTimeController.getInstance();
    +      // Start game time controller task
    +      GameTimeController.getInstance().start();
     
    -      AdminCommandRightsData.getInstance();
    -
    -      TaskManager.getInstance();
           GmListTable.getInstance();
    +      
    +      if (Config.SAVE_DROPPED_ITEM)
    +         ItemsOnGroundManager.getInstance();
     
    -      // Load pet data from db
    -      PetDataTable.getInstance().loadPetData();
    +      if (Config.AUTODESTROY_ITEM_AFTER > 0)
    +         ItemsAutoDestroy.getInstance();
     
    -      if (Config.ACCEPT_GEOEDITOR_CONN) {
    +      if (Config.ACCEPT_GEOEDITOR_CONN)
              GeoEditorListener.getInstance();
    -      }
     
           _shutdownHandler = Shutdown.getInstance();
           Runtime.getRuntime().addShutdownHook(_shutdownHandler);
    @@ -340,20 +348,6 @@ public class GameServer {
              _log.log(Level.WARNING, "DynamicExtension could not be loaded and initialized", ex);
           }
     
    -      // Wedding system
    -      CoupleManager.getInstance();
    -
    -      // Offline store system
    -      if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS) {
    -         OfflineTradersTable.restoreOfflineTraders();
    -      }
    -
    -      if (Config.ALLOW_AUTO_REWARDER) {
    -         AutoRewarder.load();
    -      }
    -
    -      // Initialize Event Engine
    -      EventEngine.getInstance();
     
           KnownListUpdateTaskManager.getInstance();
           if (Config.DEADLOCK_DETECTOR) {
    @@ -372,6 +366,8 @@ public class GameServer {
           long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
           _log.info("GameServer Started, free memory " + freeMem + " Mb of " + totalMem + " Mb");
           Toolkit.getDefaultToolkit().beep();
    +      
    +      StringUtil.printSection("Login");
           _loginThread = LoginServerThread.getInstance();
           _loginThread.start();
     
    @@ -408,7 +404,6 @@ public class GameServer {
           _log.log(Level.INFO, getClass().getSimpleName() + ": Server loaded in "
                 + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
     
    -      AutoAnnounceTaskManager.getInstance();
           UPnPService.getInstance();
        }
     
    diff --git a/core/java/net/sf/l2j/gameserver/geoengine/GeoData.java b/core/java/net/sf/l2j/gameserver/geoengine/GeoData.java
    index e370c2e9c43961c06718a21e2b811b9df266f944..c357bedf132ed674e602dba0ac96e6e7b5ceb05a 100644
    --- a/core/java/net/sf/l2j/gameserver/geoengine/GeoData.java
    +++ b/core/java/net/sf/l2j/gameserver/geoengine/GeoData.java
    @@ -57,13 +57,13 @@ public class GeoData {
                    final Boolean loadFile = Config.GEODATA_REGIONS.get(regionX + "_" + regionY);
                    if (loadFile != null) {
                       if (loadFile) {
    -                     LOGGER.info(getClass().getSimpleName() + ": Loading " + geoFilePath.getFileName() + "...");
    +                     //LOGGER.info(getClass().getSimpleName() + ": Loading " + geoFilePath.getFileName() + "...");
                          _driver.loadRegion(geoFilePath, regionX, regionY);
                          loadedRegions++;
                       }
                    } else if (Config.TRY_LOAD_UNSPECIFIED_REGIONS && Files.exists(geoFilePath)) {
                       try {
    -                     LOGGER.info(getClass().getSimpleName() + ": Loading " + geoFilePath.getFileName() + "...");
    +                     //LOGGER.info(getClass().getSimpleName() + ": Loading " + geoFilePath.getFileName() + "...");
                          _driver.loadRegion(geoFilePath, regionX, regionY);
                          loadedRegions++;
                       } catch (Exception e) {
    diff --git a/core/java/net/sf/l2j/util/StringUtil.java b/core/java/net/sf/l2j/util/StringUtil.java
    index 9e476e577c52d1d203ff196bd2b4a7c554334be9..f6757477a3a5c60d6a5f2bfbb749babdbf426301 100644
    --- a/core/java/net/sf/l2j/util/StringUtil.java
    +++ b/core/java/net/sf/l2j/util/StringUtil.java
    @@ -14,6 +14,8 @@
      */
     package net.sf.l2j.util;
     
    +import java.util.logging.Logger;
    +
     /**
      * String utilities optimized for the best performance.
      *
    @@ -196,6 +198,8 @@ package net.sf.l2j.util;
      * @author fordfrog
      */
     public final class StringUtil {
    +   protected static final Logger _log = Logger.getLogger(StringUtil.class.getName());
    +   
        private StringUtil() {
        }
     
    @@ -217,6 +221,21 @@ public final class StringUtil {
     
           return sbString.toString();
        }
    +   
    +   /**
    +    * Format a given text to fit with logging "title" criterias, and send it.
    +    * @param text : the String to format.
    +    */
    +   public static void printSection(String text)
    +   {
    +      final StringBuilder sb = new StringBuilder(80);
    +      for (int i = 0; i < (73 - text.length()); i++)
    +         sb.append("-");
    +      
    +      StringUtil.append(sb, "=[ ", text, " ]");
    +      
    +      _log.info(sb.toString());
    +   }
     
        /**
         * Creates new string builder with size initialized to <code>sizeHint</code>,


    [Share] "Modern" Console log format JKOLdYK

    Sponsored content


    [Share] "Modern" Console log format Empty Re: [Share] "Modern" Console log format

    Post  Sponsored content


      Current date/time is 7th May 2024, 06:23