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.PipelineConfigAppenderBase
-
- 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 class Loki4jAppender extends PipelineConfigAppenderBase
Main appender that provides functionality for sending log record batches to Loki. This class is responsible for converting Logback event to internal log record representation and sending it to the pipeline.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.github.loki4j.logback.PipelineConfigAppenderBase
PipelineConfigAppenderBase.BasicAuth, PipelineConfigAppenderBase.BatchCfg, PipelineConfigAppenderBase.HttpCfg
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDISABLE_SMD_PATTERN
-
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)LogRecordeventToLogRecord(ch.qos.logback.classic.spi.ILoggingEvent event)voidsetLabels(java.lang.String labelsPattern)voidsetMessage(ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent> messageLayout)voidsetReadMarkers(boolean readMarkers)voidsetStructuredMetadata(java.lang.String structuredMetadataPattern)voidsetVerbose(boolean verbose)voidstart()voidstop()-
Methods inherited from class com.github.loki4j.logback.PipelineConfigAppenderBase
buildPipelineConfig, isStaticLabels, setBatch, setHttp, setMetricsEnabled
-
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
addFilter, buildReentryGuard, 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
-
-
-
-
Field Detail
-
DISABLE_SMD_PATTERN
public static final java.lang.String DISABLE_SMD_PATTERN
- See Also:
- Constant Field Values
-
-
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>
-
eventToLogRecord
public LogRecord eventToLogRecord(ch.qos.logback.classic.spi.ILoggingEvent event)
-
setLabels
public void setLabels(java.lang.String labelsPattern)
-
setStructuredMetadata
public void setStructuredMetadata(java.lang.String structuredMetadataPattern)
-
setMessage
public void setMessage(ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent> messageLayout)
-
setReadMarkers
public void setReadMarkers(boolean readMarkers)
-
setVerbose
public void setVerbose(boolean verbose)
-
-