schema

package
v0.0.0-...-0c89eb9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 11 Imported by: 11

Documentation

Index

Constants

View Source
const LARGE_BYTES_LIMIT = 20_000
View Source
const SMALL_BYTES_LIMIT = 1_000

these limits are to make sure the log packet stays below 65k as required by UDP. * the SMALL_BYTES_LIMIT is for headers normally governed by a browser, including: referer, user-agent, x-forwarded-for, x-forwarded-proto. * the LARGE_BYTES_LIMIT is for "extra headers" (user set headers) and URIs including query params.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLogRecord

type AccessLogRecord struct {
	Request                *http.Request
	HeadersOverride        http.Header
	StatusCode             int
	RouteEndpoint          *route.Endpoint
	BodyBytesSent          int
	RequestBytesReceived   int
	ExtraHeadersToLog      []string
	DisableXFFLogging      bool
	DisableSourceIPLogging bool
	RedactQueryParams      string
	RouterError            string
	LogAttemptsDetails     bool
	FailedAttempts         int
	RoundTripSuccessful    bool

	// See the handlers.RequestInfo struct for details on these timings.
	ReceivedAt                  time.Time
	AppRequestStartedAt         time.Time
	LastFailedAttemptFinishedAt time.Time
	DnsStartedAt                time.Time
	DnsFinishedAt               time.Time
	DialStartedAt               time.Time
	DialFinishedAt              time.Time
	TlsHandshakeStartedAt       time.Time
	TlsHandshakeFinishedAt      time.Time
	AppRequestFinishedAt        time.Time
	FinishedAt                  time.Time
	// contains filtered or unexported fields
}

AccessLogRecord represents a single access log line

func (*AccessLogRecord) ApplicationID

func (r *AccessLogRecord) ApplicationID() string

ApplicationID returns the application ID that corresponds with the access log

func (*AccessLogRecord) LogMessage

func (r *AccessLogRecord) LogMessage() string

LogMessage returns a string representation of the access log line

func (*AccessLogRecord) SendLog

func (r *AccessLogRecord) SendLog(ls LogSender)

func (*AccessLogRecord) WriteTo

func (r *AccessLogRecord) WriteTo(w io.Writer) (int64, error)

WriteTo allows the AccessLogRecord to implement the io.WriterTo interface

type LogSender

type LogSender interface {
	SendAppLog(appID, message string, tags map[string]string)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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