Package org.jboss.logmanager.handlers

## Class FileHandler

- java.lang.Object
- - java.util.logging.Handler
  - - org.jboss.logmanager.ExtHandler
    - - org.jboss.logmanager.handlers.WriterHandler
      - - org.jboss.logmanager.handlers.OutputStreamHandler
        - - org.jboss.logmanager.handlers.FileHandler

All Implemented Interfaces:
  `java.io.Closeable`, `java.io.Flushable`, `java.lang.AutoCloseable`, `FlushableCloseable`, `Protectable`

Direct Known Subclasses:
  `PeriodicRotatingFileHandler`, `SizeRotatingFileHandler`

    public class FileHandler
    extends OutputStreamHandler

A simple file handler.

### Field Summary

### Fields inherited from class org.jboss.logmanager.handlers.WriterHandler

`outputLock`

### Fields inherited from class org.jboss.logmanager.ExtHandler

`handlers, handlersUpdater`

### Constructor Summary

Constructors
`FileHandler()` Construct a new instance with no formatter and no output file.
`FileHandler​(java.io.File file)` Construct a new instance with the given output file.
`FileHandler​(java.io.File file, boolean append)` Construct a new instance with the given output file and append setting.
`FileHandler​(java.lang.String fileName)` Construct a new instance with the given output file.
`FileHandler​(java.lang.String fileName, boolean append)` Construct a new instance with the given output file and append setting.
`FileHandler​(java.util.logging.Formatter formatter)` Construct a new instance with the given formatter and no output file.
`FileHandler​(java.util.logging.Formatter formatter, java.io.File file)` Construct a new instance with the given formatter and output file.
`FileHandler​(java.util.logging.Formatter formatter, java.io.File file, boolean append)` Construct a new instance with the given formatter, output file, and append setting.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.io.File` `getFile()` Get the current output file.
`void` `setAppend​(boolean append)` Specify whether to append to the target file.
`void` `setFile​(java.io.File file)` Set the output file.
`void` `setFileName​(java.lang.String fileName)` Set the output file by name.

### Methods inherited from class org.jboss.logmanager.handlers.OutputStreamHandler

`getEncoding, setEncoding, setOutputStream, setWriter`

### Methods inherited from class org.jboss.logmanager.handlers.WriterHandler

`close, doPublish, flush, preWrite, safeClose`

### Methods inherited from class org.jboss.logmanager.ExtHandler

`addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCallerCalculationRequired, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect`

### Methods inherited from class java.util.logging.Handler

`getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FileHandler

    public FileHandler()

Construct a new instance with no formatter and no output file.

#### FileHandler

    public FileHandler​(java.util.logging.Formatter formatter)

Construct a new instance with the given formatter and no output file.

Parameters:
  `formatter` - the formatter

#### FileHandler

    public FileHandler​(java.util.logging.Formatter formatter,
                       java.io.File file)
                throws java.io.FileNotFoundException

Construct a new instance with the given formatter and output file.

Parameters:
  `formatter` - the formatter
  `file` - the file
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

#### FileHandler

    public FileHandler​(java.util.logging.Formatter formatter,
                       java.io.File file,
                       boolean append)
                throws java.io.FileNotFoundException

Construct a new instance with the given formatter, output file, and append setting.

Parameters:
  `formatter` - the formatter
  `file` - the file
  `append` - `true` to append, `false` to overwrite
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

#### FileHandler

    public FileHandler​(java.io.File file)
                throws java.io.FileNotFoundException

Construct a new instance with the given output file.

Parameters:
  `file` - the file
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

#### FileHandler

    public FileHandler​(java.io.File file,
                       boolean append)
                throws java.io.FileNotFoundException

Construct a new instance with the given output file and append setting.

Parameters:
  `file` - the file
  `append` - `true` to append, `false` to overwrite
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

#### FileHandler

    public FileHandler​(java.lang.String fileName)
                throws java.io.FileNotFoundException

Construct a new instance with the given output file.

Parameters:
  `fileName` - the file name
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

#### FileHandler

    public FileHandler​(java.lang.String fileName,
                       boolean append)
                throws java.io.FileNotFoundException

Construct a new instance with the given output file and append setting.

Parameters:
  `fileName` - the file name
  `append` - `true` to append, `false` to overwrite
Throws:
  `java.io.FileNotFoundException` - if the file could not be found on open

### Method Detail

#### setAppend

    public void setAppend​(boolean append)

Specify whether to append to the target file.

Parameters:
  `append` - `true` to append, `false` to overwrite

#### setFile

    public void setFile​(java.io.File file)
                 throws java.io.FileNotFoundException

Set the output file.

Parameters:
  `file` - the file
Throws:
  `java.io.FileNotFoundException` - if an error occurs opening the file

#### getFile

    public java.io.File getFile()

Get the current output file.

Returns:
  the file

#### setFileName

    public void setFileName​(java.lang.String fileName)
                     throws java.io.FileNotFoundException

Set the output file by name.

Parameters:
  `fileName` - the file name
Throws:
  `java.io.FileNotFoundException` - if an error occurs opening the file