Skip to content
jsonblocks

Sample JSON log entries

Structured log events with timestamps, severity levels, and context objects - the shape modern services emit. Copy it for testing, or open it in the viewer with one click.

Open in viewer

Structured logging records each event as JSON instead of a prose line, so log systems can filter by level, order by timestamp, and aggregate by fields like region or orderId.

The document

json
{
  "service": "checkout-api",
  "entries": [
    {
      "ts": "2026-10-04T09:14:02.118Z",
      "level": "info",
      "msg": "order created",
      "orderId": 90412,
      "amount": 49.99,
      "context": { "region": "eu-west", "retries": 0 }
    },
    {
      "ts": "2026-10-04T09:14:03.441Z",
      "level": "warn",
      "msg": "payment slow",
      "orderId": 90412,
      "latencyMs": 2314,
      "context": { "region": "eu-west", "retries": 1 }
    },
    {
      "ts": "2026-10-04T09:14:05.002Z",
      "level": "error",
      "msg": "payment failed",
      "orderId": 90413,
      "latencyMs": null,
      "context": { "region": "eu-west", "retries": 3 }
    }
  ]
}

What to notice

  • Uniform envelope: every entry carries ts, level, msg, and orderId, so filters never miss.
  • Escalation story: the same orderId moves from info to warn to error across three entries.
  • Nullable measurements: latencyMs is null on the failed event where no timing exists.
  • Context objects group ambient fields (region, retries) away from the message.

Open it in the viewer

  1. Follow the viewer link to load this exact document.

  2. Search for orderId 90412 to highlight the full escalation.

  3. Collapse the context objects to scan the timeline quickly.

Frequently asked questions

How do I open this example in the viewer?

Use the open-in-viewer link on this page: it loads this exact document into the block visualizer with repeated shapes pre-collapsed.

Should logs be JSON or JSONL?

JSONL in production: one event per line appends cleanly and streams well. The JSON array here is the same events collected for inspection - see the JSON vs JSONL guide for the trade-offs.

What fields should every log event carry?

At minimum a timestamp, a severity level, and a message. Add a correlation id (like orderId here) so one story can be traced across many events.