public class JsonLogStream extends java.lang.Object implements ILogStream
| Constructor and Description |
|---|
JsonLogStream(JsonLogCollector collector,
Labels labels)
Constructor of stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Drop old data and next prepare StringBuilder to start new chunk of stream.
|
void |
closeStreamsEntryTag()
Appends JSON tags which closes streams array and JSON root object.
|
java.lang.String |
flush()
Provide stream data and clear old logs.
|
java.lang.StringBuilder |
getStringBuilder()
Provides access to internal string builder for custom purposes.
|
void |
log(long timestampMs,
java.lang.String line)
Thread-safe method used to write log messages to a stream.
|
void |
release()
Release log stream, so it isn't longer managed by its log collector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlogpublic JsonLogStream(JsonLogCollector collector, Labels labels)
JsonLogCollector.collector - JsonLogCollector instance which manages this stream.labels - Static labels related to this stream.
There should not be two streams with the same set of static labels.public void log(long timestampMs,
java.lang.String line)
ILogStreamlog in interface ILogStreamtimestampMs - Usually System.currentTimeMillis().line - Log content.public void release()
ILogStreamrelease in interface ILogStreampublic void closeStreamsEntryTag()
public java.lang.StringBuilder getStringBuilder()
public void clear()
public java.lang.String flush()