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

pass application name #5

Closed zoinkydoink closed 3 years ago

zoinkydoink commented 3 years ago

I will be using this to write multiple app's data to one channel, A simple configuration addition of setting application name would be awesome and should be passed along with the message

SeppPenner commented 3 years ago

Do you mean something like a message title?

zoinkydoink commented 3 years ago

No, let say I have 2 apps that write to the same telegram channel. app1 sends a whole bunch of messages and so does app2, there is no way of knowing which message came from which app. a simple configuration addition to appsettings.json called "ApplicationName" that I can set per app, and once messages are sent to telegram, this setting is passed along each message so it can easily be identifiable when looking at messages on telegram.

Also another note, it would be nice to be able to customize the "This message occured on xyx...."

zoinkydoink commented 3 years ago

My suggestion for customizing the message would be

  1. ability to remove the "This message occurred on "
  2. add a line break between the main message and the date/this line to make it easily readable
  3. make the line italic so it is visually distinct from rest https://core.telegram.org/api/entities
SeppPenner commented 3 years ago

Ok, I will check this soon, sounds like a good idea :)

zoinkydoink commented 3 years ago

I have created a pull request for some of the items, review it and let me know

SeppPenner commented 3 years ago

Sorry for the late reply, I had a lot of things to do. I will try to check this tomorrow, but it already looks good from a first view :)

SeppPenner commented 3 years ago

Fixed by https://github.com/SeppPenner/Serilog.Sinks.Telegram/pull/7. I will release an update now,