Class SafeFileTarget

All Implemented Interfaces:
ErrorAware, LogTarget, Closeable

public class SafeFileTarget extends FileTarget
A target that will open and close a file for each logevent. This is slow but a more reliable form of logging on some filesystems/OSes. It should only be used when there is a small number of log events.
Author:
Peter Donald
  • Constructor Details

    • SafeFileTarget

      public SafeFileTarget(File file, boolean append, Formatter formatter) throws IOException
      Construct file target to write to a file with a formatter.
      Parameters:
      file - the file to write to
      append - true if file is to be appended to, false otherwise
      formatter - the Formatter
      Throws:
      IOException - if an error occurs
  • Method Details