logging

package
v0.0.0-...-7dff3de Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendCtx

func AppendCtx(parent context.Context, attr slog.Attr) context.Context

AppendCtx appends slog attributes to context

func UseBodyDump

func UseBodyDump(ctx context.Context, instance *echo.Echo, skipUrls ...string)

UseBodyDump logs request and response bodies (only if debug level is enabled)

func UseRequestLog

func UseRequestLog(ctx context.Context, instance *echo.Echo)

UseRequestLog logs request meta data

Types

type Config

type Config struct {
	LogLevelStr string `env:"LOG_LEVEL"`
	LogAsJson   bool   `env:"LOG_AS_JSON"`
	LogLevel    slog.Level
}

func (*Config) Provide

func (cfg *Config) Provide() error

Provide provides configuration for logging

type ContextHandler

type ContextHandler struct {
	slog.Handler
}

func (ContextHandler) Handle

func (ch ContextHandler) Handle(ctx context.Context, r slog.Record) error

Handle logs slog attributes

Jump to

Keyboard shortcuts

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