Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package log implements basic but useful request (access) logging middleware.

Index

Constants

View Source
const (
	DefaultLogFilename = "access.log"
	CommonLogFormat    = `{remote} ` + middleware.EmptyStringReplacer + ` [{when}] "{method} {uri} {proto}" {status} {size}`
	CombinedLogFormat  = CommonLogFormat + ` "{>Referer}" "{>User-Agent}"`
	DefaultLogFormat   = CommonLogFormat
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Next  middleware.Handler
	Rules []Rule
}

Logger is a basic request logging middleware.

func (Logger) ServeHTTP

func (l Logger) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error)

type Rule added in v0.7.0

type Rule struct {
	PathScope  string
	OutputFile string
	Format     string
	Log        *log.Logger
}

Rule configures the logging middleware.

Jump to

Keyboard shortcuts

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