gologloki

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2025 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gologloki

gologloki — loki adapter for golog

Installation

$ go get github.com/memUsins/gologloki

Usage

// with default config
logger := golog.NewLogger(gologloki.NewDefaultLokiAdapter(url))

// with custom config
logger := golog.NewLogger(gologloki.NewLokiAdapter(&gologloki.LokiConfig{
    Enable: true,
    Level:  golog.DebugLevel,
    Url: url,
    Labels: map[string]string{
        "job": "app_logs",
    },
    BatchSize:     100,
    BatchInterval: 5 * time.Second,
    RetryCount: 3,
    RetryDelay: 1 * time.Second,
    Timeout: 10 * time.Second,
}))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LokiAdapter

type LokiAdapter interface {
	golog.Adapter
}

func NewDefaultLokiAdapter

func NewDefaultLokiAdapter(url string) LokiAdapter

NewDefaultLokiAdapter returns new LokiAdapter with default config

func NewLokiAdapter

func NewLokiAdapter(cfg *LokiConfig) LokiAdapter

NewLokiAdapter returns new LokiAdapter

type LokiConfig

type LokiConfig struct {
	Enable bool

	Level golog.Level

	Url    string
	Labels map[string]string

	BatchSize     int
	BatchInterval time.Duration

	RetryCount int
	RetryDelay time.Duration

	Timeout time.Duration
}

LokiConfig core config for adapter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL