What logging and observability practices suit a MAUI app?
Short answer
Use Microsoft.Extensions.Logging via the host, with providers for debug and a remote sink (Application Insights/Sentry). Log meaningful events and errors with context, track key user flows, and monitor crash-free rates and performance.
Advertisement
AModel answer
Use Microsoft.Extensions.Logging via the host, with providers for debug and a remote sink (Application Insights/Sentry). Log meaningful events and errors with context, track key user flows, and monitor crash-free rates and performance. Keep logging cheap and avoid logging sensitive data.
builder.Logging.AddDebug();
builder.Services.AddSingleton(typeof(ILogger<>), typeof(Logger<>));
_logger.LogInformation("Order {Id} submitted", order.Id);Real-world example
Structured logs and remote telemetry let the team diagnose a production issue without reproducing it locally.
Likely follow-ups
- What logging abstraction does MAUI use? | What must you never log?
Related topics