From f731249e784b9476922ff8583f0f3bfbb6f3d194 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Thu, 2 Jul 2026 15:29:31 +0300 Subject: [PATCH] Add logging for Telegram bot proxy configuration - Enhanced logging in `Program.cs` to include information about the Telegram bot's proxy settings, improving traceability of network configurations. - This addition logs the proxy scheme, host, and port, aiding in debugging and monitoring of the bot's connectivity. --- backend/src/PnvPanel.Api/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/PnvPanel.Api/Program.cs b/backend/src/PnvPanel.Api/Program.cs index b65e001..b845f45 100644 --- a/backend/src/PnvPanel.Api/Program.cs +++ b/backend/src/PnvPanel.Api/Program.cs @@ -77,6 +77,9 @@ builder.Services.AddSingleton(sp => proxy.Credentials = new NetworkCredential(credentials[0], credentials.Length > 1 ? credentials[1] : string.Empty); } + sp.GetRequiredService>().LogInformation( + "Telegram bot using proxy {Scheme}://{Host}:{Port}", proxyUri.Scheme, proxyUri.Host, proxyUri.Port); + var handler = new SocketsHttpHandler { Proxy = proxy, UseProxy = true }; return new TelegramBotClient(token, new HttpClient(handler)); });