Interface HttpSender

  • All Superinterfaces:
    ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle
    All Known Implementing Classes:
    AbstractHttpSender, ApacheHttpSender, JavaHttpSender

    public interface HttpSender
    extends ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle
    Basic interface that all Loki4j HTTP senders must implement. Each implementation must be annotated with NoAutoStart
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getUrl()
      Get Loki target URL
      LokiResponse send​(java.nio.ByteBuffer batch)
      Send a batch to Loki
      void setContentType​(java.lang.String contentType)
      Content type of the requests to send to Loki.
      void setTenantId​(java.lang.String tenantId)
      Tenant identifier.
      void setUrl​(java.lang.String url)
      Set Loki target URL
      • Methods inherited from interface ch.qos.logback.core.spi.ContextAware

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
      • Methods inherited from interface ch.qos.logback.core.spi.LifeCycle

        isStarted, start, stop
    • Method Detail

      • send

        LokiResponse send​(java.nio.ByteBuffer batch)
        Send a batch to Loki
        Returns:
        A response from Loki
      • getUrl

        java.lang.String getUrl()
        Get Loki target URL
      • setUrl

        void setUrl​(java.lang.String url)
        Set Loki target URL
      • setTenantId

        void setTenantId​(java.lang.String tenantId)
        Tenant identifier. It is required only for sending logs directly to Loki operating in multi-tenant mode. Otherwise this setting has no effect
      • setContentType

        void setContentType​(java.lang.String contentType)
        Content type of the requests to send to Loki. It depends on the encoder selected in config (JSON vs Protobuf)