From c8e33c96ce1cbfcd37796f9edeb54f9e70ae830c Mon Sep 17 00:00:00 2001 From: HueByte Date: Thu, 19 Feb 2026 13:37:51 +0100 Subject: [PATCH] feat: Add diagnostic logging for hosted services resolution and startup timing --- src/EchoHub.Server/Program.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/EchoHub.Server/Program.cs b/src/EchoHub.Server/Program.cs index 8389ca1..78a066f 100644 --- a/src/EchoHub.Server/Program.cs +++ b/src/EchoHub.Server/Program.cs @@ -202,6 +202,15 @@ while (true) } }, heartbeatCts.Token); + // ── Enumerate hosted services (DI resolution) ──────────────────── + Console.Error.WriteLine("[DIAG] Resolving IHostedService instances from DI..."); + var hostedServices = app.Services.GetServices().ToList(); + Console.Error.WriteLine($"[DIAG] Found {hostedServices.Count} hosted services:"); + foreach (var svc in hostedServices) + Console.Error.WriteLine($"[DIAG] - {svc.GetType().FullName}"); + Console.Error.Flush(); + + // ── Start with per-service timing ───────────────────────────────── Console.Error.WriteLine("[DIAG] Calling app.StartAsync()..."); await app.StartAsync(); Console.Error.WriteLine("[DIAG] app.StartAsync() completed — server is running.");