com.ibm.mm.logging

Class LoggerManager

  • java.lang.Object
    • com.ibm.mm.logging.LoggerManager


  • public class LoggerManager
    extends java.lang.Object
    Centralized logger configuration and management Provides easy access to loggers and runtime configuration OPTIMIZED VERSION with AsyncFileHandler for high performance: - 10-50x faster logging throughput - Non-blocking publish operations - Less than 1ms latency per log
    • Constructor Summary

      Constructors 
      Constructor and Description
      LoggerManager() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void disableDebugMode()
      Disable debug mode - reset to INFO level
      static void enableDebugMode()
      Enable debug mode for the entire application Sets all com.ibm.mm loggers to FINE level
      static java.util.logging.Logger getLogger(java.lang.Class<?> clazz)
      Get logger for a specific class
      static java.util.logging.Logger getLogger(java.lang.String name)
      Get logger by name
      static java.util.logging.Level getLogLevel(java.lang.String loggerName)
      Get current log level for a logger
      static java.lang.String getPerformanceStats()
      Get performance statistics
      static int getQueueCapacity()
      Get async handler queue capacity
      static int getQueueSize()
      Get async handler queue size (for monitoring)
      static void initialize()
      Initialize logging system with high-performance async handlers Should be called once at application startup
      static boolean isInitialized()
      Check if logging system is initialized
      static boolean isQueueNearlyFull()
      Check if async queue is nearly full (greater than 80%) Useful for monitoring and alerting
      static void setLogLevel(java.lang.String loggerName, java.util.logging.Level level)
      Set log level for a specific logger dynamically
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoggerManager

        public LoggerManager()
    • Method Detail

      • initialize

        public static void initialize()
        Initialize logging system with high-performance async handlers Should be called once at application startup
      • getLogger

        public static java.util.logging.Logger getLogger(java.lang.Class<?> clazz)
        Get logger for a specific class
        Parameters:
        clazz - The class requesting the logger
        Returns:
        Logger instance for the class
      • getLogger

        public static java.util.logging.Logger getLogger(java.lang.String name)
        Get logger by name
        Parameters:
        name - Logger name
        Returns:
        Logger instance
      • setLogLevel

        public static void setLogLevel(java.lang.String loggerName,
                                       java.util.logging.Level level)
        Set log level for a specific logger dynamically
        Parameters:
        loggerName - Name of the logger
        level - New log level
      • enableDebugMode

        public static void enableDebugMode()
        Enable debug mode for the entire application Sets all com.ibm.mm loggers to FINE level
      • disableDebugMode

        public static void disableDebugMode()
        Disable debug mode - reset to INFO level
      • isInitialized

        public static boolean isInitialized()
        Check if logging system is initialized
        Returns:
        true if initialized, false otherwise
      • getLogLevel

        public static java.util.logging.Level getLogLevel(java.lang.String loggerName)
        Get current log level for a logger
        Parameters:
        loggerName - Logger name
        Returns:
        Current log level
      • getQueueSize

        public static int getQueueSize()
        Get async handler queue size (for monitoring)
        Returns:
        Number of log records waiting to be written, or -1 if not using async
      • getQueueCapacity

        public static int getQueueCapacity()
        Get async handler queue capacity
        Returns:
        Maximum queue size, or -1 if not using async
      • isQueueNearlyFull

        public static boolean isQueueNearlyFull()
        Check if async queue is nearly full (greater than 80%) Useful for monitoring and alerting
        Returns:
        true if queue is nearly full, false otherwise
      • getPerformanceStats

        public static java.lang.String getPerformanceStats()
        Get performance statistics
        Returns:
        String with performance info
Copyright © 2024 IBM Corporation

Copyright © 2024 IBM Corporation. All rights reserved.