public static Logger getLogger(String logFile, String className) {
    Logger logger;
    try {
      logger = Logger.getLogger(className);
      FileHandler fileTxt = new FileHandler(logFile);
      java.util.logging.Formatter formatterTxt = new SimpleFormatter();
      fileTxt.setFormatter(formatterTxt);
      logger.addHandler(fileTxt);
    } catch (IOException | SecurityException ex) {
      Logger.getLogger(className).log(Level.SEVERE, null, ex);
      return null;
    }
    return logger;
  }