Package com.log4rich.core
Class LogManager
java.lang.Object
com.log4rich.core.LogManager
Factory and manager for Logger instances.
Maintains a registry of loggers and provides thread-safe access.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Check if a logger exists with the given name.static Logger
Get a logger for the specified class.static Logger
Get a logger for the specified name.static String[]
Get all existing logger names.static Logger
Get the root logger.static void
reset()
Reset the logging system by removing all loggers.static void
shutdown()
Shutdown all loggers and their appenders.
-
Method Details
-
getLogger
Get a logger for the specified name.- Parameters:
name
- The logger name- Returns:
- Logger instance
-
getLogger
Get a logger for the specified class.- Parameters:
clazz
- The class to get logger for- Returns:
- Logger instance
-
getRootLogger
Get the root logger.- Returns:
- Root logger instance
-
exists
Check if a logger exists with the given name.- Parameters:
name
- The logger name- Returns:
- true if logger exists
-
getLoggerNames
Get all existing logger names.- Returns:
- Array of logger names
-
shutdown
public static void shutdown()Shutdown all loggers and their appenders. -
reset
public static void reset()Reset the logging system by removing all loggers.
-