logfiberv3

package module
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package logfiberv3 is the Fiber v3 adapter for the logcore structured logger. See the sibling logfiber package for Fiber v2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(cfg Config) fiber.Handler

Middleware returns a Fiber v3 handler that emits one structured log per request after the handler chain runs. Trace fields (trace.id, transaction.id) are attached when apmfiberv3.Middleware ran first.

Types

type Config

type Config struct {
	// SkipPaths lists request paths that bypass logging entirely.
	// Default: ["/live", "/ready", "/health"].
	SkipPaths []string

	// SkipFunc, when non-nil, is called for every request that was not
	// already skipped by SkipPaths. Returning true suppresses the log
	// entry. Use this for method-, pattern- or prefix-based skip rules:
	//
	//   cfg.SkipFunc = func(method, path string) bool {
	//       return method == "OPTIONS" || strings.HasPrefix(path, "/internal/")
	//   }
	SkipFunc func(method, path string) bool

	// Logger overrides the global logcore logger. Nil → use the global.
	Logger *logcore.Logger
}

Config tunes the middleware. All fields are optional.

Jump to

Keyboard shortcuts

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