logging

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogAppend

type LogAppend struct {
	// Key is the name of the log field.
	Key string `json:"key,omitempty"`

	// Value is the value to use for the log field.
	// If it is a placeholder (with surrounding `{}`),
	// it will be evaluated when the log is written.
	// If the value is a key that exists in the `vars`
	// map, the value of that key will be used. Otherwise
	// the value will be used as-is as a constant string.
	Value string `json:"value,omitempty"`

	// Early, if true, adds the log field before calling
	// the next handler in the chain. By default, the log
	// field is added on the way back up the middleware chain,
	// after all subsequent handlers have completed.
	Early bool `json:"early,omitempty"`
}

LogAppend implements a middleware that takes a key and value, where the key is the name of a log field and the value is a placeholder, or variable key, or constant value to use for that field.

func (LogAppend) CaddyModule

func (LogAppend) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (LogAppend) ServeHTTP

func (h LogAppend) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

func (*LogAppend) UnmarshalCaddyfile

func (h *LogAppend) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

Jump to

Keyboard shortcuts

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