Class GenerationFileHandler


public class GenerationFileHandler extends FileHandler
FileHandler with support for rotating the current file to an archival name with a specified integer suffix, and provision of a new replacement FileHandler with the current filename.
Author:
gojomo
  • Constructor Details

  • Method Details

    • getFilenameSeries

      public List<String> getFilenameSeries()
      Returns:
      Returns the filenameSeries.
    • rotate

      public GenerationFileHandler rotate(String storeSuffix, String activeSuffix) throws IOException
      Move the current file to a new filename with the storeSuffix in place of the activeSuffix; continuing logging to a new file under the original filename.
      Parameters:
      storeSuffix - Suffix to put in place of activeSuffix
      activeSuffix - Suffix to replace with storeSuffix.
      Returns:
      GenerationFileHandler instance.
      Throws:
      IOException
    • rotate

      public GenerationFileHandler rotate(String storeSuffix, String activeSuffix, boolean mergeOld) throws IOException
      Throws:
      IOException
    • shouldManifest

      public boolean shouldManifest()
      Returns:
      True if should manifest.
    • makeNew

      public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException
      Constructor-helper that rather than clobbering any existing file, moves it aside with a timestamp suffix.
      Parameters:
      filename -
      append -
      shouldManifest -
      Returns:
      Throws:
      SecurityException
      IOException
    • publish

      public void publish(LogRecord record)
      Overrides:
      publish in class FileHandler