accesslog

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessLog

type AccessLog struct {
	ClientAddr            string  `json:"ClientAddr"`
	ClientHost            string  `json:"ClientHost"`
	DownstreamStatus      int     `json:"DownstreamStatus"`
	RequestMethod         string  `json:"RequestMethod"`
	RequestPath           string  `json:"RequestPath"`
	RequestProtocol       string  `json:"RequestProtocol"`
	RequestHost           string  `json:"RequestHost"`
	ServiceName           string  `json:"ServiceName"`
	OriginDuration        int64   `json:"OriginDuration"` // nanoseconds
	OriginContentSize     int64   `json:"OriginContentSize"`
	Time                  string  `json:"time"`
	Logger                string  `json:"logger"`
	DownstreamContentSize int64   `json:"DownstreamContentSize"`
	Timestamp             float64 `json:"ts"`
	Status                int     `json:"status"`
	Duration              float64 `json:"duration"`
	Size                  int64   `json:"size"`
	Request               struct {
		RemoteIP string `json:"remote_ip"`
		ClientIP string `json:"client_ip"`
		Proto    string `json:"proto"`
		Method   string `json:"method"`
		Host     string `json:"host"`
		URI      string `json:"uri"`
	} `json:"request"`
}

AccessLog represents a JSON proxy access log entry.

type Formatter

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

Formatter handles formatting of access logs

func NewFormatter

func NewFormatter(verbose bool) *Formatter

NewFormatter creates a new log formatter

func (*Formatter) FormatHeader

func (f *Formatter) FormatHeader() string

FormatHeader returns a formatted header for the log output

func (*Formatter) FormatLine

func (f *Formatter) FormatLine(line string) (string, error)

FormatLine formats a single JSON log line into human-readable output

func (*Formatter) SetServiceFilter

func (f *Formatter) SetServiceFilter(serviceName string)

SetServiceFilter sets a filter to only show logs for a specific service

Jump to

Keyboard shortcuts

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