Class LogStreamManager

java.lang.Object
com.ultikits.ultitools.manager.LogStreamManager
All Implemented Interfaces:
org.bukkit.event.Listener

@Internal public class LogStreamManager extends Object implements org.bukkit.event.Listener
Log stream manager. Responsible for monitoring server logs in real time and transmitting them to UltiPanel via WebSocket.
Version:
2.0.0
Author:
UltiKits
  • Field Details

  • Constructor Details

    • LogStreamManager

      private LogStreamManager()
  • Method Details

    • getInstance

      public static LogStreamManager getInstance()
    • shutdown

      public void shutdown()
      Shuts down the log stream manager.
    • detachAllSystemLogHandlers

      private void detachAllSystemLogHandlers()
      Detaches every one of this framework's SystemLogHandler instances from the JVM root logger.

      Deliberately scans by type and removes every instance, rather than only removing this.systemLogHandler: before this method existed, every successful reconnect attached one more to the root logger, the field could only ever hold onto the last one, and the previously-leaked ones had no reference pointing at them any more and so could never be detached. Only a type-based scan can clean up the whole historical backlog at once, and that is also the only formulation under which the acceptance criterion "handler count is always 1" can hold. See issue #181.