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

Bad Request: message is too long. 400 error. #33

Open devsienko opened 1 year ago

devsienko commented 1 year ago

If a message is too long Telegram returns 400 http error and nothing happens. We don't' see any messages in the chat.

SeppPenner commented 1 year ago

Nice one :) I will provide a new version soon :)

devsienko commented 1 year ago

Thank you, but there is another issue related with this one. It's not a problem to split text to few chunks but Telegram returns 400 if we split it betwee opening and closing html tags. For example we have a big message " ... 6000 symbols message ... " and we split it into two parts " ... 4000 symbol message" and "... 2000 symbols message . I don't know how to do it with a little effort. I just did a small dirty hack , I created a fork and removed tags in the big messages:)

SeppPenner commented 1 year ago

Thank you, but there is another issue related with this one. It's not a problem to split text to few chunks but Telegram returns 400 if we split it betwee opening and closing html tags. For example we have a big message " ... 6000 symbols message ... " and we split it into two parts " ... 4000 symbol message" and "... 2000 symbols message . I don't know how to do it with a little effort. I just did a small dirty hack , I created a fork and removed tags in the big messages:)

Ah ok, I need to check this. Let me just re-open the issue for now to not forget about it.

SeppPenner commented 10 months ago

Maybe, we should just throw an error and log to self log and add it as hint for developers to split their messages on their own? Splitting HTML based content properly seems quite difficult.

SeppPenner commented 7 months ago

Maybe, we should just throw an error and log to self log and add it as hint for developers to split their messages on their own? Splitting HTML based content properly seems quite difficult.

This will be my new idea now.