request_log

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const HTTPRequestMessageConfig = "http_request"

Variables

This section is empty.

Functions

func Middleware

func Middleware(pathsExclude router.PathsExclude, cfg ...*Config) router.Middleware

Types

type Config

type Config struct {
	Message     string
	LoggerLevel log.Level
	LogFields   func(injector.ResponseWriterExporter, *http.Request) []log.Field
}

func ConfigFromTags

func ConfigFromTags(level log.Level, tags Tags) *Config

func StandardConfig

func StandardConfig(level log.Level, withBody bool) *Config

type Tag

type Tag string
const (
	TagTime      Tag = "time"
	TagProtocol  Tag = "protocol"
	TagIP        Tag = "ip"
	TagHost      Tag = "host"
	TagMethod    Tag = "method"
	TagPath      Tag = "path"
	TagURL       Tag = "url"
	TagUA        Tag = "ua"
	TagLatency   Tag = "latency"
	TagStatus    Tag = "status"
	TagReqBody   Tag = "request_body"
	TagRoute     Tag = "route"
	TagReqHeader Tag = "request_header"
	TagQuery     Tag = "query"

	TagRespHeader Tag = "response_header"
	TagRespBody   Tag = "response_body"
)

func (Tag) String

func (t Tag) String() string

type Tags

type Tags []Tag

Jump to

Keyboard shortcuts

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