4.1.0 - 2026-08-14
Changes
- Report missing or invalid configuration as a
LoggerTelegramBackend.ConfigErrorwith a message explaining how to fix it, instead of a bare{:missing_config, key}tuple.attach/1andconfigure/1now return the exception struct, so code matching on{:missing_config, key}needs updating - Validate
:level,:metadataand:metadata_filterwhen the backend is attached or reconfigured, rather than accepting them and crashing on the first event.:tokenmust be a string. Setting an option tonilstill means "use the default" - Filter and render events by the level the caller actually used.
LoggerBackendscollapses the eightLoggerlevels into four before a backend sees them, solevel: :criticalused to discard everything, includingLogger.emergency/1. All eight levels now work as expected, and the tag in the message shows the level the caller logged with - Accept the deprecated
level: :warnas:warninginstead of emitting a deprecation warning for every event - Keep the bot token out of crash reports,
:sys.get_state/1and failure messages written to stderr - Bound the inspect output of individual metadata values, so one large term (
:crash_reasonundermetadata: :all, for example) no longer uses up the whole message - Document every configuration option, message filtering and the caveats of logging to Telegram in the README, which is now also the module documentation
- Test compatibility with Elixir 1.20 and OTP 29
Bug fixes
- Keep the backend attached when the configured HTTP client raises, throws or exits
4.0.0 - 2026-06-08
Breaking Changes
- Require Elixir 1.15 or later
- Validate required configuration during backend initialization and return an error when
:tokenor:chat_idis missing
Changes
- Require
finch0.22 or later when using the built-in HTTP client - Require
logger_backends1.0 or later - Test compatibility with Elixir 1.18 and OTP 27
Bug fixes
- Fix message truncation to respect Telegram's 4096-character message limit after HTML parsing
- Preserve part of the message budget when truncating large metadata payloads
- Avoid rendering an empty
<pre>block when no metadata is included - Log send failures to stderr without emitting warning stacktrace noise
- Fix the HTTP client test filename typo
- Fix README and documentation typos
3.0.0 - 2023-08-12
Breaking Changes
- Migrate built-in HTTP from
hackneytoFinch - Replace the
:adapterwith the:clientoption - Remove the
:proxyoption
Changes
- Log a warning if sending fails
- Allow messages to be filtered by a metadata key
Bug fixes
- Escape metadata fields when sending messages
- Fix deprecation warnings on Elixir 1.15
Upgrade Instructions
Dependencies
Add :finch to your list of dependencies in mix.exs:
def deps do
[
{:logger_telegram_backend, "~> 3.0"},
{:finch, "~> 0.16"},
]
endAdding the backend
In your
Application.start/2callback, add theLoggerTelegramBackendbackend:def start(_type, _args) do + LoggerTelegramBackend.attach()Remove the
:backendsconfiguration from:logger:config :logger, - backends: [LoggerTelegramBackend, :console]
Config
Configuration is now done via the LoggerTelegramBackend key:
- config :logger, :telegram,
+ config :logger, LoggerTelegramBackend,
# ...HTTP client (optional)
Remove the
:adapterconfiguration andAdd the
:clientoption and pass your own module that implements theLoggerTelegramBackend.HTTPClientbehaviourconfig :logger, LoggerTelegramBackend, - adapter: {Tesla.Adapter.Gun, []} + client: MyGunAdapterSee the documentation for
LoggerTelegramBackend.HTTPClientfor more information.
Proxy (optional)
Remove the
:proxyconfigurationAdd the
:client_pool_optsconfigurationconfig :logger, LoggerTelegramBackend, - proxy: "socks5://127.0.0.1:9050" + client_pool_opts: [conn_opts: [proxy: {:http, "127.0.0.1", 9050, []}]]See Pool Configuration Options for further information.
2.0.1 - 2021-05-02
Fixed
- Don't crash if sending an event does not succeed
2.0.0 - 2020-12-22
Changed
- Use tesla to make the underlying HTTP client configurable
Breaking Changes
Make hackney an optional dependency. To use the default
hackneybased adapter, add it to the list of dependencies:def deps do [ {:logger_telegram_backend, "~> 2.0.0"}, {:hackney, "~> 1.17"} ] end
1.3.0 - 2019-07-22
Changed
- Respect maximum message length to avoid MESSAGE_TOO_LONG errors
- Bump ex_doc from 0.20.2 to 0.21.1
1.2.1 - 2019-05-27
Changed
- Bump httpoison from 1.4.0 to 1.5.1
- Bump ex_doc from 0.19.1 to 0.20.2
1.2.0 - 2018-11-28
Added
- Add proxy support (from @mvalitov)
1.1.0 - 2018-11-26
Changed
- Remove dependency on
Poison: the success of a request is now solely determined by the HTTP status code. - Remove
GenStageand simplify the overall event handling logic - Update dependencies
1.0.3 - 2018-05-25
Added
- Add
@implattributes
Changed
- Update dependencies
- Format code
Fixed
- Fix typo in README
1.0.2 - 2018-03-01
Changed
- Update
httpoisonto 1.0
1.0.1 - 2018-02-10
Changed
- Update Dependencies