public static class TinyLoki.Settings
extends java.lang.Object
LogController object.| Constructor and Description |
|---|
Settings(java.lang.String url)
Settings constructor with initial URL value.
|
| Modifier and Type | Method and Description |
|---|---|
LabelSettings |
getLabelSettings()
Gives
LabelSettings defined by this library's user. |
ILogCollector |
getLogCollector()
Getter of
ILogCollector. |
ILogEncoder |
getLogEncoder()
Getter of
ILogEncoder. |
ILogMonitor |
getLogMonitor()
Getter of
ILogMonitor. |
ILogSender |
getLogSender()
Getter of
ILogSender. |
LogSenderSettings |
getLogSenderSettings()
Getter of
LogSenderSettings. |
LogController |
start()
Creates and starts the
LogController instance using parameters defined previously by this settings object. |
TinyLoki.Settings |
withBasicAuth(java.lang.String user,
java.lang.String pass)
Sets the HTTP Basic Auth credentials.
|
TinyLoki.Settings |
withConnectTimeout(int connectTimeout)
Sets the timeout of HTTP connection used to send logs to the Grafana Loki server.
|
TinyLoki.Settings |
withErrorLogMonitor()
Allows setting
ErrorLogMonitor explicitly. |
TinyLoki.Settings |
withGzipLogEncoder()
Sets the
ILogEncoder used to encode logs to GzipLogEncoder. |
TinyLoki.Settings |
withLabelLength(int maxLabelNameLength,
int maxLabelValueLength)
Allows changing the default limits of length of label name and value.
|
TinyLoki.Settings |
withLogCollector(ILogCollector logCollector)
Allows changing the default
ILogCollector, which currently is JsonLogCollector. |
TinyLoki.Settings |
withLogEncoder(ILogEncoder logEncoder)
Allows changing the default
ILogEncoder, which currently is null (no log encoder). |
TinyLoki.Settings |
withLogMonitor(ILogMonitor logMonitor)
Allows changing the default
ILogMonitor, which currently is ErrorLogMonitor. |
TinyLoki.Settings |
withLogSender(ILogSender logSender)
Allows changing the default
ILogSender, which currently is HttpLogSender. |
TinyLoki.Settings |
withoutLogEncoder()
Resets the
ILogEncoder to no encoder, so logs will not be encoded before sending. |
TinyLoki.Settings |
withVerboseLogMonitor()
Allows setting
VerboseLogMonitor explicitly. |
public Settings(java.lang.String url)
url - URL to Loki HTTP API endpoint, usually ending with /loki/api/v1/push.public TinyLoki.Settings withBasicAuth(java.lang.String user, java.lang.String pass)
user - Username.pass - Password.TinyLoki.Settings object reference.public TinyLoki.Settings withConnectTimeout(int connectTimeout)
connectTimeout - Time in milliseconds.TinyLoki.Settings object reference.public TinyLoki.Settings withLogCollector(ILogCollector logCollector)
ILogCollector, which currently is JsonLogCollector.logCollector - Instance of custom ILogCollector.TinyLoki.Settings object reference.public TinyLoki.Settings withLogEncoder(ILogEncoder logEncoder)
ILogEncoder, which currently is null (no log encoder).logEncoder - Instance of custom ILogEncoder.TinyLoki.Settings object reference.public TinyLoki.Settings withGzipLogEncoder()
ILogEncoder used to encode logs to GzipLogEncoder.TinyLoki.Settings object reference.public TinyLoki.Settings withoutLogEncoder()
ILogEncoder to no encoder, so logs will not be encoded before sending.TinyLoki.Settings object reference.public TinyLoki.Settings withLogMonitor(ILogMonitor logMonitor)
ILogMonitor, which currently is ErrorLogMonitor.logMonitor - Instance of custom ILogMonitor.TinyLoki.Settings object reference.public TinyLoki.Settings withErrorLogMonitor()
ErrorLogMonitor explicitly.TinyLoki.Settings object reference.public TinyLoki.Settings withVerboseLogMonitor()
VerboseLogMonitor explicitly.TinyLoki.Settings object reference.public TinyLoki.Settings withLogSender(ILogSender logSender)
ILogSender, which currently is HttpLogSender.logSender - Instance of custom ILogSender.TinyLoki.Settings object reference.public TinyLoki.Settings withLabelLength(int maxLabelNameLength, int maxLabelValueLength)
maxLabelNameLength - Custom value of label name length. Must be positive.maxLabelValueLength - Custom value of label value length. Must be positive.TinyLoki.Settings object reference.LabelSettings,
LabelSettings.DEFAULT_MAX_LABEL_NAME_LENGTH,
LabelSettings.DEFAULT_MAX_LABEL_VALUE_LENGTH,
Labels,
Labels.prettify(Labels, int, int)public LogSenderSettings getLogSenderSettings()
LogSenderSettings. Used by TinyLoki to initialize the HttpLogSender.LogSenderSettings instance in this settings object.public ILogCollector getLogCollector()
ILogCollector. Used by TinyLoki to obtain selected log collector.log collector.public ILogEncoder getLogEncoder()
ILogEncoder.ILogEncoder or null if there is no encoder.public ILogMonitor getLogMonitor()
ILogMonitor. Used by TinyLoki to obtain selected log monitor.log monitor.public ILogSender getLogSender()
ILogSender. Used by TinyLoki to obtain selected log sender.log sender.public LabelSettings getLabelSettings()
LabelSettings defined by this library's user.LabelSettings.public LogController start()
LogController instance using parameters defined previously by this settings object.LogController instance.