cloudflare / cloudflare/workerd

Structured JSON logs with Error object show as empty object literal on Cloudflare dashboard despite having data

Open
#5,968 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

### What versions & operating system are you using?

Wrangler 4.33.1, Node 22.19.0, macOS 15.6.1

### Please provide a link to a minimal reproduction

_No response_

### Describe the Bug

I am using custom structured JSON logs in my code: https://developers.cloudflare.com/workers/observability/logs/workers-logs/#custom-logs

I am seeing a difference in the structured JSON logs output from `wrangler dev` and what appears in the Observability section of my Cloudflare dashboard.

`Error` object instances appear nicely formatted in the local console, but on the dashboard appear as `{}`. I know for sure there is content since I stringily the error object and log it later.

```ts
} catch (e) {
console.error('Segment failed:', {runId, segmentId: segment.id, error: e});
const error = stringifyError(e, 1000);
```

---

Wrangler Dev:

Image

---

Dashboard:

(note: $workers.truncated is false)

Image

---

Is this data actually in the logs and simply not displayed in the dashboard, or is there some logic that would compact the output in the dashboard?

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.