Closeable
, Flushable
, AutoCloseable
, FlushableCloseable
, Protectable
PeriodicRotatingFileHandler
, SizeRotatingFileHandler
public class FileHandler extends OutputStreamHandler
handlers, handlersUpdater
outputLock
Constructor | Description |
---|---|
FileHandler() |
Construct a new instance with no formatter and no output file.
|
FileHandler(File file) |
Construct a new instance with the given output file.
|
FileHandler(File file,
boolean append) |
Construct a new instance with the given output file and append setting.
|
FileHandler(String fileName) |
Construct a new instance with the given output file.
|
FileHandler(String fileName,
boolean append) |
Construct a new instance with the given output file and append setting.
|
FileHandler(Formatter formatter) |
Construct a new instance with the given formatter and no output file.
|
FileHandler(Formatter formatter,
File file) |
Construct a new instance with the given formatter and output file.
|
FileHandler(Formatter formatter,
File file,
boolean append) |
Construct a new instance with the given formatter, output file, and append setting.
|
Modifier and Type | Method | Description |
---|---|---|
File |
getFile() |
Get the current output file.
|
void |
setAppend(boolean append) |
Specify whether to append to the target file.
|
void |
setFile(File file) |
Set the output file.
|
void |
setFileName(String fileName) |
Set the output file by name.
|
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEncoding, setEncoding, setOutputStream, setWriter
public FileHandler()
public FileHandler(Formatter formatter)
formatter
- the formatterpublic FileHandler(Formatter formatter, File file) throws FileNotFoundException
formatter
- the formatterfile
- the fileFileNotFoundException
- if the file could not be found on openpublic FileHandler(Formatter formatter, File file, boolean append) throws FileNotFoundException
formatter
- the formatterfile
- the fileappend
- true
to append, false
to overwriteFileNotFoundException
- if the file could not be found on openpublic FileHandler(File file) throws FileNotFoundException
file
- the fileFileNotFoundException
- if the file could not be found on openpublic FileHandler(File file, boolean append) throws FileNotFoundException
file
- the fileappend
- true
to append, false
to overwriteFileNotFoundException
- if the file could not be found on openpublic FileHandler(String fileName) throws FileNotFoundException
fileName
- the file nameFileNotFoundException
- if the file could not be found on openpublic FileHandler(String fileName, boolean append) throws FileNotFoundException
fileName
- the file nameappend
- true
to append, false
to overwriteFileNotFoundException
- if the file could not be found on openpublic void setAppend(boolean append)
append
- true
to append, false
to overwritepublic void setFile(File file) throws FileNotFoundException
file
- the fileFileNotFoundException
- if an error occurs opening the filepublic File getFile()
public void setFileName(String fileName) throws FileNotFoundException
fileName
- the file nameFileNotFoundException
- if an error occurs opening the fileCopyright © 2019 JBoss by Red Hat. All rights reserved.