Package com.jk.core.logging
Class JKLoggerFactory
java.lang.Object
com.jk.core.logging.JKLoggerFactory
This class represents a factory used to create
JKLogger objects.- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()This method closes the logger factory.static FileThis method gets the current log file.static JKLoggerThis method gets the suitable logger associated with the provided class.static JKLoggerThis method constructs a newJKLoggerwith the provided name.static voidinit(Properties properties) This method initiates a logger with the specified properties.static voidinitFromConfigFile(String fileName) This method constructs a new logger with the specified configuration in the provided file.static voidThis main method tests the construction of loggers by creating a logger associated with theIntegerclass
-
Constructor Details
-
JKLoggerFactory
public JKLoggerFactory()
-
-
Method Details
-
getLogger
This method gets the suitable logger associated with the provided class.- Parameters:
class1- Specifies the class associated with the logger.- Returns:
- the logger associated with the provided class.
-
getLogger
This method constructs a newJKLoggerwith the provided name.- Parameters:
name- Specifies the new logger name.- Returns:
- the logger.
-
main
This main method tests the construction of loggers by creating a logger associated with theIntegerclass- Parameters:
args- the command line arguments.
-
getCurrentLogFile
This method gets the current log file.- Returns:
- the current log file, or null if there's no current file.
-
close
public static void close()This method closes the logger factory. -
init
This method initiates a logger with the specified properties.- Parameters:
properties- Specifies the properties of the logger to create.
-
initFromConfigFile
This method constructs a new logger with the specified configuration in the provided file.- Parameters:
fileName- Specifies the logger configuration file name.
-