NLog.Telegram.Format.Core 1.0.3

dotnet add package NLog.Telegram.Format.Core --version 1.0.3
NuGet\Install-Package NLog.Telegram.Format.Core -Version 1.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLog.Telegram.Format.Core" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLog.Telegram.Format.Core --version 1.0.3
#r "nuget: NLog.Telegram.Format.Core, 1.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NLog.Telegram.Format.Core as a Cake Addin
#addin nuget:?package=NLog.Telegram.Format.Core&version=1.0.3

// Install NLog.Telegram.Format.Core as a Cake Tool
#tool nuget:?package=NLog.Telegram.Format.Core&version=1.0.3

NLog.Telegram

An NLog target for Telegram with the avaiable format which provided by Telgram. Available format: MARKDOWN HTML5 for more : https://core.telegram.org/bots/api#formatting-options

This repository referenced by : https://github.com/narfunikita/NLog.Telegram


Usage

  1. Create a TelegramBot(https://core.telegram.org/bots#3-how-do-i-create-a-bot).
  2. Configure NLog to use NLog.Telegram: https://github.com/nlog/nlog/wiki/Configuration-file

NLog.config

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <extensions>
    <add assembly="NLog.Telegram.Format" />
  </extensions>

  <targets async="true">
    <target xsi:type="Telegram"
            name ="telegramTarget"
			layout="${message}"
            botToken ="xxx"
            chatId="xxx"
            format="MARKDOWN"
            />
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="telegramTarget" />
  </rules>
</nlog>

Example

	var log = LogManager.GetCurrentClassLogger();

	log.Debug($"`hello world` **hello world** __hello world__");

Configuration Options

Key Description
BotToken Your telegram bot token (e.g 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11)
ChatId Unique identifier for the message recipient � User or GroupChat id
BaseUrl Optional. Api bot Url. Default: https://api.telegram.org/bot
Format Optional. Render layout for telegram message. Default : DEFAULT

Reference: https://github.com/narfunikita/NLog.Telegram

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 13,194 3/27/2019
1.0.2 511 3/25/2019
1.0.0 499 3/25/2019

Fix problem async pending.