// Package logging provides enterprise-grade structured logging for rdev. // It wraps slog with standardized field names, context propagation, // automatic sensitive data redaction, and per-component log levels. package logging // Standard field names for structured logging. // Using constants ensures consistent field names across the codebase, // making logs queryable and reducing typos. const ( // Request/trace context FieldRequestID = "request_id" FieldTraceID = "trace_id" FieldSpanID = "span_id" // User/auth context FieldUserID = "user_id" FieldAPIKeyID = "api_key_id" FieldAPIKeyTag = "api_key_tag" // Project context FieldProjectID = "project_id" FieldProjectName = "project_name" // Component identification FieldComponent = "component" FieldHandler = "handler" FieldService = "service" FieldWorker = "worker" FieldAdapter = "adapter" // Operation context FieldOperation = "operation" FieldAction = "action" FieldMethod = "method" FieldPath = "path" FieldStatus = "status" // Error handling - ALWAYS use "error", never "err" or "e" FieldError = "error" FieldErrorCode = "error_code" FieldErrorType = "error_type" FieldStackTrace = "stack_trace" // Performance/timing FieldDuration = "duration_ms" FieldStartTime = "start_time" FieldEndTime = "end_time" FieldRetryCount = "retry_count" // Resource identifiers FieldPodName = "pod_name" FieldNamespace = "namespace" FieldContainerID = "container_id" FieldBuildID = "build_id" FieldDeploymentID = "deployment_id" FieldWorkID = "work_id" FieldQueueName = "queue_name" // HTTP context FieldHTTPMethod = "http_method" FieldHTTPPath = "http_path" FieldHTTPStatus = "http_status" FieldHTTPRemoteAddr = "http_remote_addr" FieldHTTPUserAgent = "http_user_agent" FieldHTTPHost = "http_host" // Audit context FieldAuditAction = "audit_action" FieldAuditResource = "audit_resource" FieldAuditResult = "audit_result" FieldAuditDetails = "audit_details" )