logging

package
v0.0.0-...-d69904b Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package logging provides a fast, asynchronous request logger which outputs NCSA/Apache combined logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingHandler

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

A LoggingHandler is a HTTP handler which proxies requests to an underlying handler and logs the results.

func Wrap

func Wrap(h http.Handler, w io.Writer) *LoggingHandler

Wrap returns the underlying handler, wrapped in a LoggingHandler which will write to the given Writer. N.B.: You must call Start() on the result before using it.

func (*LoggingHandler) ServeHTTP

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

func (*LoggingHandler) Start

func (al *LoggingHandler) Start()

Start creates a goroutine to handle the logging IO.

func (*LoggingHandler) Stop

func (al *LoggingHandler) Stop()

Stop closes the internal channel used to buffer log statements and waits for the IO goroutine to complete.

Jump to

Keyboard shortcuts

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