What problem does it solve?
This skill provides a comprehensive approach to implementing structured logging in Cloudflare Workers, addressing issues of request correlation and sensitive data redaction in a production environment.
Core Features & Use Cases
- SafeLogger Implementation: Safely redacts Personal Identifiable Information (PII) from log entries.
- Request Correlation: Utilizes AsyncLocalStorage for maintaining request and trace context.
- BaseLogFields Schema: Defines a schema for required fields in log entries, ensuring consistency and queryability.
- Event Naming Conventions: Standardizes event naming for easier categorization and querying.
- Logger Factory Patterns: Provides environment-aware configuration for different layers (domain, application, infrastructure).
- Use Case: For a developer who needs to log application events in a structured and secure manner while working with Cloudflare Workers.
Quick Start
Use the structured-logging skill to configure structured logging for your Cloudflare Worker application, ensuring that your logs are secure, correlated, and follow the defined schema.