svclog

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package svclog provides logging facilities for standard services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(cfg Config) logrus.FieldLogger

NewLogger returns a new logger that includes app and deploy key/value pairs in each log line.

func NewSampleLogger added in v0.0.19

func NewSampleLogger(parentLogger logrus.FieldLogger, logsBurstLimit int, logBurstWindow time.Duration) logrus.FieldLogger

NewSampleLogger creates a rate limited logger that samples logs. The parameter logsBurstLimit defines how many logs are allowed per logBurstWindow duration. The returned logger derives from the parentLogger, but without inheriting any Hooks. All log entries derived from SampleLogger will contain 'sampled=true' field.

func SaramaLogger

func SaramaLogger(logger logrus.FieldLogger) logrus.FieldLogger

SaramaLogger takes FieldLogger and returns a saramaLogger.

Types

type Config

type Config struct {
	AppName  string `env:"APP_NAME,required"`
	Deploy   string `env:"DEPLOY,required"`
	SpaceID  string `env:"SPACE_ID"`
	Dyno     string `env:"DYNO"`
	LogLevel string `env:"LOG_LEVEL,default=info"`
}

Config for logger.

Jump to

Keyboard shortcuts

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