-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
Per PR #77 and this comment, context.log must be implemented in the edge adapters.
Requirements
Configuration
context.attributes.loggers = ['target1', 'target2']- array of log targets
Fastly Implementation
- Use
fastly:loggerwith multiplexing to all configured loggers - Automated enrichment based on context (requestId, functionName, region, etc.)
- Support both structured (objects) and plain strings (converted to
{ message }objects)
Cloudflare Implementation
- Use tail workers - one tail worker per log target
- Ensure same log structure as Fastly
- Support both structured (objects) and plain strings (converted to
{ message }objects)
API
// Structured logging
context.log.info({ user_id: 123, action: 'login' });
// Plain string logging
context.log.error('Request failed');
// becomes: { message: 'Request failed' }Current State
Both adapters currently use plain console.log() with no unified logging interface. The context object has no log property.
Fastly adapter: src/template/fastly-adapter.js
Cloudflare adapter: src/template/cloudflare-adapter.js
References
- Logging analysis: docs/api-unification/logging.md
- Fastly Logger API: https://js-compute-reference-docs.edgecompute.app/docs/fastly:logger/Logger/
- Cloudflare Tail Workers: https://developers.cloudflare.com/workers/observability/logs/tail-workers/
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request