Package org.iam.utils
Class LoggerUtil
java.lang.Object
org.iam.utils.LoggerUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerconfigureLogging(String logFilePath) Configures the root logger with console and file handlers.static StringGets the current log file path.static voidmodifyLoggerLevel(Logger logger, Level level) Modifies the log level for the given logger and all its handlers.
-
Constructor Details
-
LoggerUtil
public LoggerUtil()
-
-
Method Details
-
configureLogging
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
Modifies the log level for the given logger and all its handlers.- Parameters:
logger- the Logger to modifylevel- the new log level
-
getLogFilePath
Gets the current log file path.- Returns:
- the log file path
-