WithTenantID includes the tenant ID in log records (for multi-tenant functions).
()
| 40 | |
| 41 | // WithTenantID includes the tenant ID in log records (for multi-tenant functions). |
| 42 | func 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, |
no outgoing calls
searching dependent graphs…