🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/procolost/zap-loki

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/procolost/zap-loki

v0.2.0
Source
Go
Version published
Created
Source

zap-loki

This lib provides a sink for Zap that can send logs to a Loki instance via HTTP.

Usage

func initLogger() (*zap.Logger, error) {
    zapConfig := zap.NewProductionConfig()
    loki := zaploki.New(context.Background(), zaploki.Config{
        Url:          lokiAddress,
        BatchMaxSize: 1000,
        BatchMaxWait: 10 * time.Second,
        Labels:       map[string]string{"app": appName},
    })

    return loki.WithCreateLogger(zapConfig)
}

FAQs

Package last updated on 09 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts