Table of Contents

Log

The framework exposes a global Log type for application logging without dependency injection.

Features

  • Global access: Log.Error(), Log.Warning(), Log.Information(), Log.Debug(), Log.Trace(), and Log.Dump()
  • Background queueing: messages are queued and flushed on a background thread instead of blocking the calling thread
  • Custom output: supports file output, stdout/stderr, and custom ILogWriter implementations
  • Enrichment: can attach request and user context when available

Behavior

Log writes are checked against the configured minimum log level before being queued. Log.Dump() is the direct-write debug helper for cases where immediate output is more useful than queueing.

Log.Warning("Retrying request");
Log.Dump("diagnostic payload");

The framework can also forward logs to stdout/stderr or consume stdout/stderr with an ILogWriter implementation when configured through the framework logging pipeline.

Caveats

  • Log.Dump() bypasses some of the normal queue and filter behavior and is meant for diagnostics, not production logging.
  • File logging is a fallback behavior; custom sinks are preferred in production systems.
  • Logging is not a substitute for structured observability systems such as Application Insights, Datadog, or OpenTelemetry.
Tip

Implement ILogWriter and register it as a singleton to route messages to your preferred sink while keeping the framework’s formatting and enrichment behavior consistent.

AppSettings

View all appsettings here