apache_logger

package
v0.1.43 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApacheFormatPattern = "%s - - [%s] \"%s %d %d\" %f\n"

Functions

func NewApacheLoggingHandler

func NewApacheLoggingHandler(handler http.Handler, out io.Writer, pre, post *AProcFunc) http.Handler

Types

type AProcFunc

type AProcFunc func(which PrePost, record *ApacheLogRecord, www http.ResponseWriter, req *http.Request)
var DBACleanupFunc AProcFunc = func(which PrePost, record *ApacheLogRecord, www http.ResponseWriter, req *http.Request) {
	if which == AProcPost {
		ymux.CleanupValue(www, req)
	}
}

A Post Sample.

type ApacheLogRecord

type ApacheLogRecord struct {
	http.ResponseWriter

	Ip            string
	Time          time.Time
	Method        string
	Uri           string
	Protocol      string
	Status        int
	ResponseBytes int64
	ElapsedTime   time.Duration
}

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 {
	Pre  []*AProcFunc
	Post []*AProcFunc
	// contains filtered or unexported fields
}

func (*ApacheLoggingHandler) AddProcFunc

func (h *ApacheLoggingHandler) AddProcFunc(pre, post *AProcFunc)

func (*ApacheLoggingHandler) ServeHTTP

func (h *ApacheLoggingHandler) ServeHTTP(www http.ResponseWriter, req *http.Request)

type PrePost

type PrePost int
const (
	AProcPre  PrePost = 1
	AProcPost PrePost = 2
)

func (PrePost) String

func (xx PrePost) String() string

Jump to

Keyboard shortcuts

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