Add logging for Telegram bot proxy configuration
CI / Backend (build + test) (push) Successful in 1m21s
CI / Frontend (lint + typecheck + build) (push) Successful in 33s

- 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.
This commit is contained in:
Leonid Pershin
2026-07-02 15:29:31 +03:00
parent 5f005b6496
commit f731249e78
+3
View File
@@ -77,6 +77,9 @@ builder.Services.AddSingleton<ITelegramBotClient>(sp =>
proxy.Credentials = new NetworkCredential(credentials[0], credentials.Length > 1 ? credentials[1] : string.Empty);
}
sp.GetRequiredService<ILogger<Program>>().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));
});