Skip to content

faascape/log

 
 

Repository files navigation

log

Go logging library used at Mailgun.

Usage

Define a logging configuration in a YAML config file. Currently "console" and "syslog" loggers are supported (you can omit one or another):

logging:
  - name: console
  - name: syslog

Logging config can be built into your program's config struct:

import "github.com/mailgun/log"


type Config struct {
  // some program-specific configuration

  // logging configuration
  Logging []*log.LogConfig
}

After config parsing, initialize the logging library:

import (
  "github.com/mailgun/cfg"
  "github.com/mailgun/log"
)

func main() {
  conf := Config{}

  // parse config with logging configuration
  cfg.LoadConfig("path/to/config.yaml", &conf)

  // init the logging package
  log.Init(conf.Logging)
}

About

Go logging library used at Mailgun.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%