log

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log logs every request. Every log provider can be used which implements the log.Interface. The log information is remoteAddr, HTTP Method, URL, Proto, HTTP Status, Response size and requested time.

logWriter := log.Get("console")
log := New(logWriter)
middleware.Add(log.MW)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	// contains filtered or unexported fields
}

Log

func New

func New(logger *logger.Logger) *Log

New returns a new Log instance.

func (*Log) MW

func (l *Log) MW(h http.HandlerFunc) http.HandlerFunc

MW will be passed to the middleware.

Jump to

Keyboard shortcuts

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