diff --git a/CHANGELOG.md b/CHANGELOG.md index e7e3ef88..4ab13837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html). +## [Unreleased] (2.4.5) +### Fixed +- The second part of [#190](https://github.com/codingteam/emulsion/issues/190): now the Telegram errors will be logged to the log file, not to the stdout. + ## [2.4.4] - 2024-02-06 ### Changed - Downgrade to .NET 7 (the hosting infrastructure turns out to be unable to handle a newer one so far). diff --git a/Emulsion.Telegram/Client.fs b/Emulsion.Telegram/Client.fs index 459874d8..73e6ccae 100644 --- a/Emulsion.Telegram/Client.fs +++ b/Emulsion.Telegram/Client.fs @@ -22,7 +22,11 @@ type Client(ctx: ServiceContext, hostingSettings: HostingSettings option) = inherit MessageSystemBase(ctx, cancellationToken) - let botConfig = { Funogram.Telegram.Bot.Config.defaultConfig with Token = telegramSettings.Token } + let botConfig = { + Funogram.Telegram.Bot.Config.defaultConfig with + Token = telegramSettings.Token + OnError = fun e -> ctx.Logger.Error(e, "Exception in Telegram message processing") + } interface ITelegramClient with member this.GetFileInfo(fileId) = async {