Urgent.News

What's breaking now, across thousands of outlets.

Tech

Structured Logging and Distributed Tracing: Moving Beyond console.log

We have all been there during an outage: staring at terminal logs searching for an error: [2026-09-25 02:14:12] Error processing request: object is None [2026-09-25 02:14:12] Failed to charge credit card [2026-09-25 02:14:13] User checked out Which user failed? What was the order ID? Did the database drop or did the payment gateway time out? Unstructured, free-text string logging ( print() ,…

Structured logging and distributed tracing are essential capabilities for modern, distributed systems. When dealing with complex, microservice-oriented architectures, traditional console.log style logging is insufficient. The challenges of pinpointing the root cause of errors become exponentially more difficult in such environments.

One key solution is structured JSON logging, which provides a machine-readable format that enables efficient querying and analysis. For example, a JSON log entry might include details such as the timestamp, log level, service name, correlation ID, customer ID, order ID, duration, and error message. This structured format allows for quick and precise queries, such as identifying all errors that occurred for a specific customer or service.

Correlation IDs play a vital role in distributed tracing. By assigning a unique trace ID and span ID to each request, it becomes possible to follow the lifecycle of an interaction across multiple services. This correlation facilitates the identification of bottlenecks, timeouts, and other performance issues that might not be immediately apparent when examining individual logs.

To implement structured logging and distributed tracing, developers can utilize middleware in their application frameworks. For instance, in a FastAPI application, a correlation middleware can be created to generate and attach a correlation ID to incoming requests. This ID is then propagated through the system, allowing each log entry to include the correlation information.

By combining structured JSON logging with distributed tracing, developers can gain valuable insights into the performance and reliability of their applications. With JSON logs, they can easily query and analyze log data to pinpoint issues and understand the flow of requests across services. Correlation IDs ensure that all related logs are linked together, providing a comprehensive view of the system's behavior during an error or latency event.

In summary, moving beyond console.log is crucial for effectively managing distributed systems. Structured JSON logging and distributed tracing with correlation IDs offer powerful tools for debugging, monitoring, and optimizing complex, microservice-based architectures.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

CVE-2026-92951: CVE-2026-92951: Sandbox Escape via External Package Allowlist Bypass in vm2

CVE-2026-92951: Sandbox Escape via External Package Allowlist Bypass in vm2 Vulnerability ID: CVE-2026-92951 CVSS Score: 9.9 Published: 2026-10-01 An incorrect authorization and directory traversal…

  • Remote attackers can bypass sandbox in vm2, execute arbitrary host code.
  • Incorrect authorization and directory traversal in external package allowlist.
  • Upgrade to vm2 version 3.11.7 or later to fix vulnerability.

"A second operation was started on this context" — the EF Core bug that only shows up under load

"A Second Operation Was Started on This Context" — The EF Core Bug That Only Shows Up Under Load You’ve debugged this error before: InvalidOperationException: A second operation was started on this…

  • Second operation started on EF Core bug under load conditions.
  • Root cause: service-lifetime design issue with fire-and-forget context leak.
  • Resolution: ensure one scope per unit of work, manage scopes explicitly.

Trying unknown Mac software without trusting it: a disposable macOS VM on Apple Silicon

At some point you want to try a Mac app you don't fully trust: a menu bar utility from a one-person shop, an installer someone linked in a forum, a CLI that wants sudo . Installing it on the machine that holds your SSH keys and browser profile is the fast option, and also the one with the worst cleanup story.

  • Disposable macOS VM on Apple Silicon tests unknown software safely.
  • VM provides separate macOS environment without affecting host system.
  • Requirements include Apple Silicon Mac, macOS 14, and compatible VM application.

More from Friday 2 October →