diff --git a/src/X.Extensions.Logging.Telegram/TelegramMessageFormatter.cs b/src/X.Extensions.Logging.Telegram/TelegramMessageFormatter.cs index ab7b4dd..272eb5c 100644 --- a/src/X.Extensions.Logging.Telegram/TelegramMessageFormatter.cs +++ b/src/X.Extensions.Logging.Telegram/TelegramMessageFormatter.cs @@ -32,11 +32,11 @@ public string Format( var sb = new StringBuilder(); sb.Append(_options.UseEmoji - ? $"{ToEmoji(logLevel)} *{DateTime.Now:HH:mm:ss}* {ToString(logLevel)}" - : $"*{DateTime.Now:HH:mm:ss}* {ToString(logLevel)}"); - + ? $"{ToEmoji(logLevel)} {DateTime.Now:HH:mm:ss} {ToString(logLevel)}" + : $"{DateTime.Now:HH:mm:ss} {ToString(logLevel)}"); + sb.AppendLine(); - sb.Append($"`{_name}`"); + sb.Append($"
{_name}
"); sb.AppendLine(); sb.AppendLine($"Message: {message}"); @@ -45,14 +45,14 @@ public string Format( if (exception != null) { sb.AppendLine(); - sb.AppendLine($"`{exception}`"); + sb.AppendLine($"
{exception}
"); sb.AppendLine(); } if (!string.IsNullOrWhiteSpace(_options.Source)) { sb.AppendLine(); - sb.Append($"_Source: {_options.Source}_"); + sb.Append($"Source: {_options.Source}"); } sb.AppendLine(); diff --git a/src/X.Extensions.Logging.Telegram/TelegramWriter.cs b/src/X.Extensions.Logging.Telegram/TelegramWriter.cs index 915ada2..45b120b 100644 --- a/src/X.Extensions.Logging.Telegram/TelegramWriter.cs +++ b/src/X.Extensions.Logging.Telegram/TelegramWriter.cs @@ -23,6 +23,6 @@ public TelegramWriter(string accessToken, string chatId) } public async Task Write(string message) => - await _client.SendTextMessageAsync(_chatId, message, ParseMode.Markdown); + await _client.SendTextMessageAsync(_chatId, message, ParseMode.Html); } } \ No newline at end of file