Skip to content

procolost/zap-loki

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%