logging

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ApacheFormatPattern = "%s - - [%s] \"%s %d %d\" %f %s\n"
View Source
const MaxFormPrefix = 256

Variables

This section is empty.

Functions

func FormPrefix

func FormPrefix(form url.Values) string

func NewApacheLoggingHandler

func NewApacheLoggingHandler(handler http.Handler, logHandlers ...LogRecordHandler) http.Handler

Types

type ApacheLogRecord

type ApacheLogRecord struct {
	http.ResponseWriter

	IP                    string
	Time                  time.Time
	Method, URI, Protocol string
	Status                int
	ResponseBytes         int64
	ElapsedTime           time.Duration
	FormPrefix            string
}

func (*ApacheLogRecord) Log

func (r *ApacheLogRecord) Log(out io.Writer)

func (*ApacheLogRecord) Write

func (r *ApacheLogRecord) Write(p []byte) (int, error)

func (*ApacheLogRecord) WriteHeader

func (r *ApacheLogRecord) WriteHeader(status int)

type ApacheLoggingHandler

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

func (*ApacheLoggingHandler) ServeHTTP

func (h *ApacheLoggingHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type LogRecordHandler

type LogRecordHandler func(*ApacheLogRecord)

func LogToWriter

func LogToWriter(out io.Writer) LogRecordHandler

Jump to

Keyboard shortcuts

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