Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PaymentXMLPatterns = sanitization.PaymentXMLPatterns

PaymentXMLPatterns are pre-configured XML patterns for payment payloads.

View Source
var RapidConnectXMLPatterns = sanitization.RapidConnectXMLPatterns

RapidConnectXMLPatterns are aliases for PaymentXMLPatterns.

Functions

func Logger

Logger returns the global structured logger singleton.

func SanitizeFieldValue

func SanitizeFieldValue(key string, value any) any

SanitizeFieldValue applies deterministic redaction rules to a field value.

func SanitizeJSON

func SanitizeJSON(jsonBytes []byte) string

SanitizeJSON returns a sanitized JSON string for safe logging.

func SanitizeJSONValue

func SanitizeJSONValue(jsonBytes []byte) any

SanitizeJSONValue returns a sanitized JSON structure for structured logging.

Prefer this over SanitizeJSON when using a JSON logger; it avoids escaping JSON as a string.

func SanitizeLogString

func SanitizeLogString(value string) string

SanitizeLogString removes control characters that could enable log forging.

func SanitizeXML

func SanitizeXML(xmlString string, patterns []sanitization.XMLSanitizationPattern) string

SanitizeXML masks sensitive data in XML using the provided patterns.

func SetLogger

func SetLogger(next observability.StructuredLogger)

SetLogger replaces the global structured logger singleton.

Passing nil resets the logger to a no-op implementation.

Types

type RawJSON

type RawJSON = sanitization.RawJSON

RawJSON is a marker type for JSON payloads that should be sanitized and logged as structured JSON.

Jump to

Keyboard shortcuts

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