Package com.github.loki4j.logback
Class AbstractLoki4jEncoder
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- com.github.loki4j.logback.AbstractLoki4jEncoder
-
- All Implemented Interfaces:
ch.qos.logback.core.spi.ContextAware,ch.qos.logback.core.spi.LifeCycle,Loki4jEncoder
- Direct Known Subclasses:
JsonEncoder,ProtobufEncoder
public abstract class AbstractLoki4jEncoder extends ch.qos.logback.core.spi.ContextAwareBase implements Loki4jEncoder
Abstract class that provides basic Loki4j batch encoding functionality
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractLoki4jEncoder.LabelCfg
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.charset.Charsetcharset
-
Constructor Summary
Constructors Constructor Description AbstractLoki4jEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringeventToMessage(ch.qos.logback.classic.spi.ILoggingEvent e)LogRecordStreameventToStream(ch.qos.logback.classic.spi.ILoggingEvent e)AbstractLoki4jEncoder.LabelCfggetLabel()booleangetSortByTime()booleangetStaticLabels()booleanisStarted()voidsetLabel(AbstractLoki4jEncoder.LabelCfg label)voidsetMessage(ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent> message)voidsetSortByTime(boolean sortByTime)voidsetStaticLabels(boolean staticLabels)voidstart()voidstop()inttimestampToNanos(long timestampMs)-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Methods inherited from interface com.github.loki4j.logback.Loki4jEncoder
getWriterFactory
-
-
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfacech.qos.logback.core.spi.LifeCycle
-
stop
public void stop()
- Specified by:
stopin interfacech.qos.logback.core.spi.LifeCycle
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfacech.qos.logback.core.spi.LifeCycle
-
eventToStream
public LogRecordStream eventToStream(ch.qos.logback.classic.spi.ILoggingEvent e)
- Specified by:
eventToStreamin interfaceLoki4jEncoder
-
eventToMessage
public java.lang.String eventToMessage(ch.qos.logback.classic.spi.ILoggingEvent e)
- Specified by:
eventToMessagein interfaceLoki4jEncoder
-
timestampToNanos
public int timestampToNanos(long timestampMs)
- Specified by:
timestampToNanosin interfaceLoki4jEncoder
-
getLabel
public AbstractLoki4jEncoder.LabelCfg getLabel()
-
setLabel
public void setLabel(AbstractLoki4jEncoder.LabelCfg label)
-
setMessage
public void setMessage(ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent> message)
-
getSortByTime
public boolean getSortByTime()
- Specified by:
getSortByTimein interfaceLoki4jEncoder
-
setSortByTime
public void setSortByTime(boolean sortByTime)
-
getStaticLabels
public boolean getStaticLabels()
- Specified by:
getStaticLabelsin interfaceLoki4jEncoder
-
setStaticLabels
public void setStaticLabels(boolean staticLabels)
-
-