accesslog

package
v0.0.0-...-8487dac Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package accesslog logs HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(existing http.Handler, dest Logger) http.Handler

Handler wraps an existing http.Handler and logs any requests routed along to the handler, in the following format:

127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

Output is logged to the dest parameter. If dest is nil, the default logger of the log package is used.

Types

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

Types implementing the Logger interface can be used as destinations for access log messages. The Printf method must be safe for concurrent use among multiple goroutines.

Jump to

Keyboard shortcuts

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