Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.1 KB

README.md

File metadata and controls

31 lines (23 loc) · 1.1 KB

Serilog.Sinks.TelegramBot

NuGet Version License: MIT

A Serilog sink that writes events as messages to Telegram.

All you need is bot token and chat id. To manage bots go to Bot Father. After you got bot token add bot to contacts and start it (/start). To get your id navigate to https://api.telegram.org/botTOKEN/getUpdates

Available for

  • .Net 7.0
  • .Net 8.0
  • .Net 9.0

Install

Install-Package Serilog.Sinks.TelegramBot

Basic usage:

var log = new LoggerConfiguration()
                .MinimumLevel.Verbose()
                .WriteTo.TelegramBot("000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "000000")
                .CreateLogger();
log.Information("This is an information message!");

Example

Simple Message