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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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