Skip to content

Commit a6a7bf2

Browse files
authored
Configure platform log fields (#2147)
1 parent 67d1862 commit a6a7bf2

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

‎apps/cloud/docs/platform-logs.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Platform logs
2+
3+
Apply `apps/cloud/logpush.json` to the account's `workers_trace_events` Logpush
4+
job as the JSON body of `PUT /accounts/{account_id}/logpush/jobs/{job_id}`.
5+
This updates output fields without changing the destination or event selection.
6+
Wrangler's `logpush: true` enables export for the Worker; it does not manage
7+
the account-level job configuration.
8+
9+
The field list retains outcomes, logs, exceptions, timings and script metadata.
10+
It excludes `Event`, which contains request URLs and other source-event data.
11+
Worker observability query redaction is separate from Logpush output selection.
12+
Redacted request paths and HTTP statuses remain available in application traces.
13+
14+
After applying, read back the job's output options and check newly delivered
15+
records at the destination. Allow for configuration propagation and in-flight
16+
batches. Verify that `Event` is absent and retained diagnostic fields still arrive.
17+
This does not remove historical records or sanitize arbitrary console messages.

‎apps/cloud/logpush.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"output_options": {
3+
"output_type": "ndjson",
4+
"timestamp_format": "rfc3339",
5+
"field_names": [
6+
"CPUTimeMs",
7+
"DispatchNamespace",
8+
"Entrypoint",
9+
"EventTimestampMs",
10+
"EventType",
11+
"Exceptions",
12+
"Logs",
13+
"Outcome",
14+
"ScriptName",
15+
"ScriptTags",
16+
"ScriptVersion",
17+
"WallTimeMs"
18+
]
19+
}
20+
}

‎apps/cloud/wrangler.jsonc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
// Axiom. Pinned here because the setting lives on the script: a deploy that
4242
// omits it can reset it to false, which is how the export silently died in
4343
// the July deploy-tooling migration.
44+
// Account-level output fields are configured separately via logpush.json;
45+
// see docs/platform-logs.md.
4446
"logpush": true,
4547
"durable_objects": {
4648
"bindings": [

0 commit comments

Comments
 (0)