logging

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 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 ContextKey

type ContextKey string
const (
	RequestIDKey ContextKey = "request_id"
)

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(verbose, accessLog bool) *Logger

func (*Logger) AccessLog

func (l *Logger) AccessLog() bool

func (*Logger) CertGenerated

func (l *Logger) CertGenerated(certPath, keyPath string)

func (*Logger) InvalidHost

func (l *Logger) InvalidHost(requestID string, host string, reason string)

func (*Logger) LogRequest

func (l *Logger) LogRequest(ctx context.Context, method, host string, targetPort int, statusCode int, latency time.Duration, bytesWritten int64, err error)

func (*Logger) PortDenied

func (l *Logger) PortDenied(requestID string, port int, reason string)

func (*Logger) ProxyError

func (l *Logger) ProxyError(requestID string, targetPort int, err error)

func (*Logger) ServerStarted

func (l *Logger) ServerStarted(addr string)

func (*Logger) ServerStarting

func (l *Logger) ServerStarting(addr, certPath, keyPath string, selfSigned bool)

func (*Logger) WebSocketUpgrade

func (l *Logger) WebSocketUpgrade(requestID string, targetPort int)

func (*Logger) WithRequestID

func (l *Logger) WithRequestID(requestID string) *Logger

Jump to

Keyboard shortcuts

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