public interface LogWriter extends Runnable
Writers run on a background thread, building batches of messages and attempting to send them to the destination.
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(LogMessage message)
Adds a message to the writer waiting for batch.
|
void |
setBatchDelay(long value)
Sets the batch delay for the writer.
|
void |
setDiscardAction(MessageQueue.DiscardAction value)
Updates the writer's discard action: how it discards messages once the threshold
has been reached.
|
void |
setDiscardThreshold(int value)
Updates the writer's discard threshold: the maximum number of message stored
in its queue.
|
void |
stop()
Signals the writer that it will no longer receive batches.
|
void addMessage(LogMessage message)
Implementations should assume that they are invoked within a synchronized block, and therefore should not perform excessive amounts of work.
void stop()
run() method.void setBatchDelay(long value)
If the writer doesn't support batching, this will be a no-op.
void setDiscardThreshold(int value)
void setDiscardAction(MessageQueue.DiscardAction value)
Copyright © 2018. All rights reserved.