code: public static FileHandler getFileHandler(String processId,
                                             String loggingDir,
                                             boolean append,
                                             ByteAmount limit,
                                             int count) throws IOException, SecurityException {
  
      String pattern = loggingDir + "/" + processId + ".log.%g";
  
  
      FileHandler fileHandler = new FileHandler(pattern, (int) limit.asBytes(), count, append);
      fileHandler.setFormatter(new SimpleFormatter());
      fileHandler.setEncoding(StandardCharsets.UTF_8.toString());
  
      return fileHandler;
    }
docs: Initialize a <tt>FileHandler</tt> to write to a set of files
  with optional append.  When (approximately) the given limit has
  been written to one file, another file will be opened.  The
  output will cycle through a set of count files.
  The pattern of file name should be: ${processId}.log.index
  <p>
  The <tt>FileHandler</tt> is configured based on <tt>LogManager</tt>
  properties (or their default values) except that the given pattern
  argument is used as the filename pattern, the file limit is
  set to the limit argument, and the file count is set to the
  given count argument, and the append mode is set to the given
  <tt>append</tt> argument.
  <p>
  The count must be at least 1.
  
  @param limit the maximum number of bytes to write to any one file
  @param count the number of files to use
  @param append specifies append mode
  @throws IOException if there are IO problems opening the files.
  @throws SecurityException if a security manager exists and if
  the caller does not have <tt>LoggingPermission("control")</tt>.
  @throws IllegalArgumentException if {@code limit < 0}, or {@code count < 1}.
  @throws IllegalArgumentException if pattern is an empty string