httplog

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingRoundTripper added in v1.2.13

func LoggingRoundTripper(logger log.Logger, transport ...http.RoundTripper) http.RoundTripper

func TraceDo added in v1.2.14

func TraceDo(logger log.Logger, do Do, req *http.Request) (*http.Response, error)

Types

type Do added in v1.2.14

type Do interface {
	Do(req *http.Request) (*http.Response, error)
}

type HTTPWriter

type HTTPWriter struct {
	log.BatchSupport
	log.RetrySupport
	log.FilterSupport
	log.FormatSupport

	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)

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