Class JKLoggerFactory

java.lang.Object
com.jk.core.logging.JKLoggerFactory

public class JKLoggerFactory extends Object
This class represents a factory used to create JKLogger objects.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • JKLoggerFactory

      public JKLoggerFactory()
  • Method Details

    • getLogger

      public static JKLogger getLogger(Class class1)
      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

      public static JKLogger getLogger(String name)
      This method constructs a new JKLogger with the provided name.
      Parameters:
      name - Specifies the new logger name.
      Returns:
      the logger.
    • main

      public static void main(String[] args)
      This main method tests the construction of loggers by creating a logger associated with the Integer class
      Parameters:
      args - the command line arguments.
    • getCurrentLogFile

      public static File 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

      public static void init(Properties properties)
      This method initiates a logger with the specified properties.
      Parameters:
      properties - Specifies the properties of the logger to create.
    • initFromConfigFile

      public static void initFromConfigFile(String fileName)
      This method constructs a new logger with the specified configuration in the provided file.
      Parameters:
      fileName - Specifies the logger configuration file name.