serilog-contrib / Serilog.Sinks.Telegram.Alternative

Serilog.Sinks.Telegram.Alternative is a library to save logging information from Serilog to Telegram.
MIT License
36 stars 12 forks source link

Feature: Add support for output templates. #29

Closed prodigy closed 2 years ago

prodigy commented 2 years ago

Implemented support for output templates. The features works very much like the one from Serilog.Sinks.Console and is strongly inspired by their work.

When no output template is given, the old behaviour is preserved.

An example output template would be:

{Level:e} [{ApplicationName}] {Message:lj}{NewLine}{Exception}

This then, for example, renders as

⚠️ [MyApp] Some strange event occurred.
SeppPenner commented 2 years ago

Wow, nice :) I know the output templates already, but didn't yet think about integrating them. Great work, I will check / test this and add it to the next version soon.