Overview
Logs help you understand what your backend app is doing while it runs in your Cloudflare account.
With log, you declare structured log streams directly in your Layeron app.
Each stream uses Layeron’s platform namespace/name identity, so records carry
ownership context from the moment they are emitted.
Layeron records the log stream in your app specification, creates a Log Product Worker, enables Worker observability during deployment, and emits structured records through WorkerEntrypoint RPC. The first runtime target writes those records to Cloudflare Workers Logs.
With Layeron Logs, you can:
- Create named log streams from application code.
- Group records with platform namespace/name identity.
- Emit debug, info, warning, error, and fatal messages.
- Capture errors with structured attributes.
- Emit application events through the same stream.
- Apply sampling to normal and error records.
- Redact sensitive attributes before records leave your handler.
- Retain records in a Storage-backed archive when the stream needs durable history.
- Keep the log path inside Layeron’s compile and deploy pipeline.
How Logs Fit In Layeron
Section titled “How Logs Fit In Layeron”Layeron treats logs as a backend capability. The declaration flows through the same platform path as other capabilities:
User code -> AppSpec -> RuntimeTopology -> Log Product Worker -> WorkerEntrypoint RPC -> Cloudflare Workers Logs -> Storage bucket archive when retention.mode is archiveThis keeps log behavior inspectable, testable, and tied to deployment records.
Related Capabilities
Section titled “Related Capabilities”Use observability for metrics, timings, trace spans, and operational signals.
Use log for human-readable application logs, structured events, and error
capture.
Next Steps
Section titled “Next Steps”- Get started: Create a named stream, emit route logs, capture errors, sample records, redact fields, and set retention.
- Runtime and retention: Review stream identity, runtime records, Workers Logs sampling, retention, and integrations.
- Observability: Use metrics, events, timings, spans, and signals when logs need structured product telemetry.
- API reference: Review Log options, levels, sinks, capture settings, and module methods.