zaphttp

package module
v0.0.0-...-4cbb4e2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 9

README

Go Reference

ugent-library/zaphttp

Package zaphttp contains middleware to help use the zap structured logger in your HTTP handlers.

Install

go get -u github.com/ugent-library/zaphttp

Documentation

Overview

Package zaphttp contains middleware to help use the zap structured logger in your HTTP handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(c context.Context) *zap.Logger

Retrieve the zap logger set with the SetLogger middleware from Context.

func SetLogger

func SetLogger(logger *zap.Logger, opts ...Option) func(http.Handler) http.Handler

SetLogger is a middleware to set a zap logger in the request Context.

Types

type Option

type Option func(*zap.Logger, *http.Request) *zap.Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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