Table of Contents

Logging

CodeBlock DevKit treats observability as a default, not something you bolt on later. For each HTTP request, the stack records a continuous story: the request arriving (method, URL, headers, query, and—unless you mark an endpoint sensitive—the body), work flowing through the pipeline (including commands, queries, and domain events dispatched through IRequestDispatcher), and the response going out (status, timing, and—on API hosts where it applies—response logging). You do not implement that pipeline yourself; it runs as part of the hosted web and API clients you build on the template.

What you control is mainly how much gets captured and where noise is tuned down—through Monitoring:Logging in each client’s appsettings.json, plus optional attributes when a route or type must redact bodies or payloads (see Services and Tutorials).

While you develop locally, logs are written to the console with structured detail, so you can follow a single request in your terminal or IDE output without extra setup. In environments where the Monitoring module is enabled, the same log stream can also be exported to MongoDB and browsed from the Admin Panel alongside traces and metrics—but that storage and UI layer belongs to the Monitoring module; this documentation stays focused on logging behavior and configuration.

Where to go next

  • Configuration — The Monitoring section in appsettings (service identity and Logging knobs such as minimum level and category filters).
  • Services — What is automatic versus what you opt into (ILogger, redaction attributes, API response logging).
  • Tutorials — Copy-pastable patterns: ILogger in your types, [DoNotLog] on commands and DTOs, HTTP body/response markers, and pointers to related topics.