logging

package
v0.0.0-...-be41bbe Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DebugLogLevel debug
	DebugLogLevel = "debug"

	// InfoLogLevel info
	InfoLogLevel = "info"

	// WarnLogLevel warn
	WarnLogLevel = "warn"

	// ErrorLogLevel error
	ErrorLogLevel = "error"

	// FatalLogLevel fatal
	FatalLogLevel = "fatal"

	// TextLoggingFormat text log format type
	TextLoggingFormat = "text"

	// JSONLoggingFormat json log format type
	JSONLoggingFormat = "json"

	// TimestampFormat standard log time format
	TimestampFormat = "02/Jan/2006:15:04:05 -0700"
)

Variables

This section is empty.

Functions

func DeinitializeLogging

func DeinitializeLogging()

DeinitializeLogging cleans up any resources related to logging

func InitLogging

func InitLogging(config *LogConfig) error

InitLogging initializes logging for the application

func LoggerMiddleware

func LoggerMiddleware() echo.MiddlewareFunc

LoggerMiddleware returns a Logger middleware that will log requests based on if the logRequests config flag is set.

Types

type LogConfig

type LogConfig struct {
	File           string `mapstructure:"file"`
	Level          string `mapstructure:"level"`
	Format         string `mapstructure:"format"`
	LogRequests    bool   `mapstructure:"log-requests"`
	LogStartupInfo bool   `mapstructure:"log-startup-info"`
}

LogConfig provides configuration for initializing application logging

Jump to

Keyboard shortcuts

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