@MinDoc(copyright="Copyright 2006, 2009 A. Weinert", author="Albrecht Weinert", version="V.39", lastModified="17.04.2021", usage="use for (java.) logging", purpose="a handler for logging") public class LogWriterHandler extends LogHandler
Handler
connecting the
java.util.logging
API to a PrintWriter
, like for
example App
.log
verbindet.TextHelper
,
TimeHelper
Modifier and Type | Field and Description |
---|---|
PrintWriter |
writer
The Writer for logging.
|
Constructor and Description |
---|
LogWriterHandler(PrintWriter writer)
Make a LogWriterHandler with default formatter.
|
LogWriterHandler(PrintWriter writer,
Formatter formatter)
Make a LogWriterHandler.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this Handlers.
|
void |
flush()
Flush the underlying Writer.
|
void |
publish(LogRecord record)
Format and output a "LogRecord".
|
getFormatter, isClosed, isLoggable, setFilter, setFormatter, setLevel
getEncoding, getErrorManager, getFilter, getLevel, reportError, setEncoding, setErrorManager
public final PrintWriter writer
public LogWriterHandler(PrintWriter writer, Formatter formatter)
public LogWriterHandler(PrintWriter writer)
public void publish(LogRecord record)
formatter
will format
record
. The result will be output to the PrintWriter
writer
.LogWriterHandler
not being closed plus the
log and filter conditions.publish
in class Handler
record
- description of the event to be loggedHandler.isLoggable(LogRecord)