Skip to content

gromanev/serilog-sinks-telegram

 
 

Repository files navigation

Serilog.Sinks.Telegram

NuGet Version

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

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

Example

Simple Message

About

Telegram sink for serilog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%