Package com.github.loki4j.logback
Class Loki4jAppender
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
- com.github.loki4j.logback.Loki4jAppender
-
- All Implemented Interfaces:
ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>,ch.qos.logback.core.spi.ContextAware,ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>,ch.qos.logback.core.spi.LifeCycle
public final class Loki4jAppender extends ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>Main appender that provides functionality for sending log record batches to Loki
-
-
Constructor Summary
Constructors Constructor Description Loki4jAppender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(ch.qos.logback.classic.spi.ILoggingEvent event)voidsetBatchMaxBytes(int batchMaxBytes)voidsetBatchMaxItems(int batchMaxItems)voidsetBatchTimeoutMs(long batchTimeoutMs)voidsetDrainOnStop(boolean drainOnStop)voidsetFormat(Loki4jEncoder encoder)"format" instead of "encoder" in the name allows to specify the default implementation, so users don't have to write full-qualified class name by defaultvoidsetHttp(HttpSender sender)"http" instead of "sender" is just to have a more clear name for the configuration sectionvoidsetMaxRetries(int maxRetries)voidsetMetricsEnabled(boolean metricsEnabled)voidsetRetryTimeoutMs(long retryTimeoutMs)voidsetSendQueueMaxBytes(long sendQueueMaxBytes)voidsetUseDirectBuffers(boolean useDirectBuffers)voidsetVerbose(boolean verbose)voidstart()voidstop()-
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
startin classch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
stop
public void stop()
- Specified by:
stopin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
stopin classch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
append
protected void append(ch.qos.logback.classic.spi.ILoggingEvent event)
- Specified by:
appendin classch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
setBatchMaxItems
public void setBatchMaxItems(int batchMaxItems)
-
setBatchMaxBytes
public void setBatchMaxBytes(int batchMaxBytes)
-
setBatchTimeoutMs
public void setBatchTimeoutMs(long batchTimeoutMs)
-
setSendQueueMaxBytes
public void setSendQueueMaxBytes(long sendQueueMaxBytes)
-
setMaxRetries
public void setMaxRetries(int maxRetries)
-
setRetryTimeoutMs
public void setRetryTimeoutMs(long retryTimeoutMs)
-
setFormat
public void setFormat(Loki4jEncoder encoder)
"format" instead of "encoder" in the name allows to specify the default implementation, so users don't have to write full-qualified class name by default
-
setHttp
public void setHttp(HttpSender sender)
"http" instead of "sender" is just to have a more clear name for the configuration section
-
setVerbose
public void setVerbose(boolean verbose)
-
setMetricsEnabled
public void setMetricsEnabled(boolean metricsEnabled)
-
setDrainOnStop
public void setDrainOnStop(boolean drainOnStop)
-
setUseDirectBuffers
public void setUseDirectBuffers(boolean useDirectBuffers)
-
-