Telegram excessive logging problem

I manage medium sized active openhab installation with a telegram binding used for coms.

Telegram binding works very well, except one particular situation: few times a month, global internet connection fails for a dozen of minutes (not related to openhab in any way).

Telegram binding gets “crazy” logging warnings every 100msec or faster, which fills log turbo fast and is unnecessary (example below). Of course I can disable completely telegram WARN+ logging but it is not solution. I do want to see that there is a problem but ONCE, not once every milisecond :wink: Repeating error once a minute/hour would be enough.

Any suggestions how to solve it?

Log example (there are few thousands of them):

2024-06-08 21:54:57.551 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:57.690 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:57.828 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:57.966 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.104 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.242 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.380 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.519 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.657 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.795 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:58.933 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway
2024-06-08 21:54:59.071 [WARN ] [.openhab.binding.telegram.internal.TelegramHandler] Telegram exception: GetUpdates failed with error_code 502 Bad
 Gateway

You’re options are:

  • change the logging level as you indicate
  • set a filter in log4j2.xml to completely does that log statement but only that log statement
  • file an issue on the binding to change the logging behavior when network is lost

I have this too if I’m offline… But not that much.
do you have a rule that want to ‘contact’ the telegram service often?
I would imagine that this error message is related to a request with the telegram server.
Greets

Thanks for suggestions. I’ll go with option 2 and 3.