abstract class LogWriter extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected LogManager | _manager_manager. |
protected boolean | _writeWhether the writer should continue writing |
(package private) static long | FLUSH_INTERVALajax refresh interval |
| Constructor and Description |
|---|
LogWriter(LogManager manager)Creates a new LogWriter |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void | closeWriter()Close the writer |
abstract String | currentFile()File may not exist or have old logs in it if not opened yet |
void | flushRecords()Flush pending log records |
void | flushRecords(boolean shouldWait)Flush pending log records, optionally waiting for new ones |
protected abstract void | flushWriter()Flush the writer output |
void | run()run. |
void | setFlushInterval(long interval)Set the flush interval for the log writer. |
void | stopWriting()Stop the log writer thread |
void | wakeup()Wake up the writer to immediately re-read config and flush pending records. |
protected abstract void | writeRecord(int priority,
String line)Write a single String verbatim to the writer. |
protected abstract void | writeRecord(LogRecord rec,
String formatted)Write the provided LogRecord to the writer. |
protected final LogManager _manager
protected volatile boolean _write
static final long FLUSH_INTERVAL
public LogWriter(LogManager manager)
manager - the log managerprotected abstract void closeWriter()
public abstract String currentFile()
public void flushRecords()
public void flushRecords(boolean shouldWait)
shouldWait - whether to wait for new recordsprotected abstract void flushWriter()
public void setFlushInterval(long interval)
interval - the interval in millisecondspublic void stopWriting()
public void wakeup()
protected abstract void writeRecord(int priority,
String line)priority - the level to log the line at.line - the String to write.