Package org.iam.utils

Class LoggerUtil

java.lang.Object
org.iam.utils.LoggerUtil

public class LoggerUtil extends Object
Utility class for configuring and managing logging.

Provides methods to set up logging handlers, formatters, and log levels. Supports colored console output and plain file output.

  • Constructor Details

    • LoggerUtil

      public LoggerUtil()
  • Method Details

    • configureLogging

      public static Logger configureLogging(String logFilePath)
      Configures the root logger with console and file handlers. Console output uses color formatting, file output is plain text.
      Parameters:
      logFilePath - the path to the log file
      Returns:
      the configured Logger instance
    • modifyLoggerLevel

      public static void modifyLoggerLevel(Logger logger, Level level)
      Modifies the log level for the given logger and all its handlers.
      Parameters:
      logger - the Logger to modify
      level - the new log level
    • getLogFilePath

      public static String getLogFilePath()
      Gets the current log file path.
      Returns:
      the log file path