Back to results for “Architecture”
.NET MAUI › Best Practices & Architecture

What logging and observability practices suit a MAUI app?

Advanced

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.

Common follow-ups: What logging abstraction does MAUI use? | What must you never log?