httplog

package
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TraceHttpRequest

func TraceHttpRequest(logger log.Logger, req *http.Request) (rid uint64)

func TraceHttpResponse

func TraceHttpResponse(logger log.Logger, res *http.Response, rid uint64)

Types

type HTTPWriter

type HTTPWriter struct {
	log.LogFilter
	log.LogFormatter
	log.BatchWriter

	URL         string // request URL
	Method      string // http method
	Insecure    bool
	Username    string // basic auth username
	Password    string // basic auth password
	ContentType string
	Timeout     time.Duration
	// contains filtered or unexported fields
}

HTTPWriter implements log Writer Interface and batch send log messages to webhook.

func (*HTTPWriter) Close

func (hw *HTTPWriter) Close()

Close flush and close the writer

func (*HTTPWriter) Flush

func (hw *HTTPWriter) Flush()

Flush flush cached events

func (*HTTPWriter) SetTimeout

func (hw *HTTPWriter) SetTimeout(timeout string) error

SetTimeout set timeout

func (*HTTPWriter) SetUrl

func (hw *HTTPWriter) SetUrl(u string) error

SetUrl set the request url

func (*HTTPWriter) Write

func (hw *HTTPWriter) Write(le *log.Event) error

Write cache log message, flush if needed

Jump to

Keyboard shortcuts

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