com.ibm.mm.logging
Class LoggerManager
- java.lang.Object
-
- com.ibm.mm.logging.LoggerManager
-
public class LoggerManager extends java.lang.ObjectCentralized 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 voiddisableDebugMode()Disable debug mode - reset to INFO levelstatic voidenableDebugMode()Enable debug mode for the entire application Sets all com.ibm.mm loggers to FINE levelstatic java.util.logging.LoggergetLogger(java.lang.Class<?> clazz)Get logger for a specific classstatic java.util.logging.LoggergetLogger(java.lang.String name)Get logger by namestatic java.util.logging.LevelgetLogLevel(java.lang.String loggerName)Get current log level for a loggerstatic java.lang.StringgetPerformanceStats()Get performance statisticsstatic intgetQueueCapacity()Get async handler queue capacitystatic intgetQueueSize()Get async handler queue size (for monitoring)static voidinitialize()Initialize logging system with high-performance async handlers Should be called once at application startupstatic booleanisInitialized()Check if logging system is initializedstatic booleanisQueueNearlyFull()Check if async queue is nearly full (greater than 80%) Useful for monitoring and alertingstatic voidsetLogLevel(java.lang.String loggerName, java.util.logging.Level level)Set log level for a specific logger dynamically
-
-
-
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 loggerlevel- 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
-
-