logging

package
v0.0.0-...-61732bf Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TimeFormat is the time format for logging.
	TimeFormat = time.RFC3339Nano
)

Variables

This section is empty.

Functions

func NewAccessLogger

func NewAccessLogger(handler http.Handler, logger zerolog.Logger) http.Handler

NewAccessLogger returns a constructed AccessLogger pointer.

func NewLogger

func NewLogger(app string, verbose bool, out io.Writer) zerolog.Logger

NewLogger returns a constructed logger.

Types

type AccessLogger

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

AccessLogger writes an NCSA combined-ish log record. Note this skips the rfc931 ident field and username as we aren't supporting either of those AFAIU. It also adds an elapsed time, and UTC time to Nanosecond precision in RFC3339 format.

func (*AccessLogger) ServeHTTP

func (al *AccessLogger) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP makes our type a http.HandlerFunc.

Jump to

Keyboard shortcuts

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