auditlog

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package auditlog provides an in-tree structured-log Audit plugin.

It implements plugin.Audit and writes one structured log line per audit event through a go-utils/log.Logger (which forge.Logger re-exports, so any Forge extension logger satisfies it directly). The extension registers it by default; disable with the extension config key auth.audit_log: false.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger = log.Logger

Logger is the plugin's logging dependency. go-utils/log.Logger (and therefore forge.Logger, a re-export of the same interface) satisfies it directly.

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is a plugin.Audit sink that logs one structured Info line per audit event.

func New

func New(logger Logger) *Plugin

New creates an audit-log plugin writing through logger. A nil logger falls back to a no-op logger rather than panicking, so a caller that forgets to wire one gets silence instead of a crash.

func (*Plugin) Name

func (p *Plugin) Name() string

Name implements plugin.Plugin.

func (*Plugin) OnAudit

func (p *Plugin) OnAudit(_ context.Context, ev plugin.Event) error

OnAudit implements plugin.Audit. It never returns an error: a logging failure must not affect the mutation that triggered it, and the registry already recovers panics from plugin hooks.

Jump to

Keyboard shortcuts

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