{
  "id": 2625900,
  "title": ".NET 10 JSON Console Logging: Stop Parsing State.Message",
  "url": "https://urgent.news/2026/08/22/net-10-json-console-logging-stop-parsing-state-message",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-22T18:47:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/ssukhpinder/net-10-json-console-logging-stop-parsing-statemessage-6p5"
  },
  "original_language": "en",
  "account": "With the transition to .NET 10, a subtle change has been introduced in JSON console logging that could break certain parsers. Previously, the formatted message was duplicated in the State.Message property. However, in the current version, the formatted message resides at the top-level Message property, while State now holds structured values. This change may cause applications that solely rely on parsing State.Message to return null values after an upgrade, even though logging continues normally. To prevent such issues, it's recommended to treat console JSON as a schema and perform contract testing, rather than just a visual check. The practical solution involves reading the top-level Message property and retaining State for structured data, while using a narrow fallback for older records. By focusing on the top-level Message and keeping State structured, parsers can avoid issues caused by duplicated messages. The official documentation advises parsers to use the top-level Message property, acknowledging that State.Message might still appear but with potentially different content. While this change doesn't result in a loss of structured logging data, it's essential to adapt parsers accordingly. One approach is to create a top-level-first rule that prioritizes the top-level Message and falls back to State.Message when necessary. This way, the canonical message remains consistent across different versions. Additionally, the structured properties inside State can be parsed separately, as they still provide valuable information for grouping or diagnostics. To ensure the integrity of the logging output, it's recommended to create an offline regression test that captures a documented legacy fixture, a real .NET 10 emitter, and a verifier. The verifier can launch the emitter, capture the JSON line, and verify the semantics without relying on a specific logging backend or external services. This test can catch more realistic failures than relying on hand-authored strings, as it verifies the presence of the top-level message, absence of redundant nested messages, and the integrity of structured values.",
  "summary": "The .NET 10 JSON console logging change is small enough to miss during an upgrade: the formatted message still exists, but a typical record no longer duplicates it at State.Message . A collector, script, or snapshot test that reads only that nested property can start returning null while the application continues logging normally. I treat console JSON as a schema whenever another process parses…",
  "key_points": [
    ".NET 10 JSON console logging now places formatted message at top-level Message property",
    "State.Message property now holds structured values, not duplicated formatted message",
    "Parsers should prioritize top-level Message, retain State for structured data"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}