accesslog

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *log.Logger) context.Handler

New make iris middleware to log access log with <logger> by log.LevelInfo.

func Sprint

func Sprint(req *http.Request, remoteAddr string, t time.Time, statusCode int, contentLength int64) string

Sprint with iris.Context and time. ref: https://en.wikipedia.org/wiki/Common_Log_Format - Parameters:

  • req: HTTP reqeust
  • remoteAddr: Requester address (or client address), e.g. iris.Context#RemoteAddr()
  • t: Time on responsing, e.g. time.Now()
  • statusCode: Response status code
  • contentLength: Response content length, e.g. convert ResponseWriter#.Header().Get("Content-Length") to int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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