8000 GitHub - paul-milne/zap-loki
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

paul-milne/zap-loki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 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.
5B5F

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0