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 void
close()
This method closes the logger factory.static File
This method gets the current log file.static JKLogger
This method gets the suitable logger associated with the provided class.static JKLogger
This method constructs a newJKLogger
with the provided name.static void
init
(Properties properties) This method initiates a logger with the specified properties.static void
initFromConfigFile
(String fileName) This method constructs a new logger with the specified configuration in the provided file.static void
This main method tests the construction of loggers by creating a logger associated with theInteger
class
-
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 newJKLogger
with 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 theInteger
class- 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.
-