MCPcopy
hub / github.com/aws/aws-lambda-go / WithTenantID

Function WithTenantID

lambdacontext/logger.go:42–46  ·  view source on GitHub ↗

WithTenantID includes the tenant ID in log records (for multi-tenant functions).

()

Source from the content-addressed store, hash-verified

40
41// WithTenantID includes the tenant ID in log records (for multi-tenant functions).
42func WithTenantID() LogOption {
43 return func(o *logOptions) {
44 o.fields = append(o.fields, field{"tenantId", func(lc *LambdaContext) string { return lc.TenantID }})
45 }
46}
47
48// NewLogHandler returns a [slog.Handler] for AWS Lambda structured logging.
49// It reads AWS_LAMBDA_LOG_FORMAT and AWS_LAMBDA_LOG_LEVEL from environment,

Callers 5

TestWithTenantIDFunction · 0.85
TestNewLogHandlerFunction · 0.85

Calls

no outgoing calls

Tested by 5

TestWithTenantIDFunction · 0.68
TestNewLogHandlerFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…