structured-logging

Implement structured logging with PII redaction and request correlation for Cloudflare Workers.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/eykd/vance-ts --skill structured-logging-eykd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: structured-logging
Source: https://github.com/eykd/vance-ts/tree/main/.claude/skills/structured-logging
Command: npx skills add https://github.com/eykd/vance-ts --skill structured-logging-eykd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

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.

Frequently Asked Questions about structured-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured logging in Cloudflare Workers?

You can implement structured logging in Cloudflare Workers by enforcing a base log fields schema, standardizing event naming conventions, and configuring environment-aware logger factories for different application layers.

How does request correlation work in Cloudflare Workers logging?

Request correlation in Cloudflare Workers logging works by utilizing AsyncLocalStorage to maintain consistent request and trace context across your application layers during execution.

What is the best way to redact PII from structured logs?

The best way to redact PII from structured logs is using a SafeLogger implementation that applies environment-aware redaction rules to safely strip sensitive data from log entries before output.

Can I use Python and Node.js libraries to enforce a structured logging schema?

Yes, you can use Python and Node.js libraries to enforce a structured logging schema, ensuring required fields are present and maintaining queryability across your Cloudflare Worker application.

Do I need prior knowledge of structured logging principles to use this in Cloudflare Workers?

Yes, you need prior knowledge of structured logging principles and Cloudflare Worker environments to effectively configure the schema enforcement and request correlation features provided by this skill.

Why standardize event naming conventions in structured logs?

You should standardize event naming conventions in structured logs to ensure easier categorization, improve queryability, and maintain consistent application event tracking across your Cloudflare Workers deployment.