https://github.com/adriankumpf/logger-telegram-backend
A logger backend for Telegram
https://github.com/adriankumpf/logger-telegram-backend
elixir logger-backend logging telegram telegram-bot-api
Last synced: about 1 year ago
JSON representation
A logger backend for Telegram
- Host: GitHub
- URL: https://github.com/adriankumpf/logger-telegram-backend
- Owner: adriankumpf
- License: mit
- Created: 2017-12-15T23:15:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-24T10:18:01.000Z (about 1 year ago)
- Last Synced: 2025-03-31T11:01:38.678Z (about 1 year ago)
- Topics: elixir, logger-backend, logging, telegram, telegram-bot-api
- Language: Elixir
- Homepage: https://hex.pm/packages/logger_telegram_backend
- Size: 222 KB
- Stars: 27
- Watchers: 5
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# LoggerTelegramBackend
[](https://github.com/adriankumpf/logger-telegram-backend/actions)
[](https://hexdocs.pm/logger_telegram_backend)
[](http://hex.pm/packages/logger_telegram_backend)
A logger backend for [Telegram](https://telegram.org/).
## Installation
Add `:logger_telegram_backend` and `:finch` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:logger_telegram_backend, "~> 3.0"},
{:finch, "~> 0.16"},
]
end
```
### Add the backend
In your `Application.start/2` callback, add the `LoggerTelegramBackend`:
```elixir
@impl true
def start(_type, _args) do
LoggerTelegramBackend.attach()
# ...
end
```
Add the following to your configuration:
```elixir
config :logger, LoggerTelegramBackend,
chat_id: "your_chat_id",
token: "yout_bot_token"
```
To create a Telegram bot, see the next section.
### Configure the Telegram bot
To create a Telegram bot, follow the instructions [here](https://core.telegram.org/bots/features#creating-a-new-bot) and get the `token` for the bot.
Then send a message to the bot and get your `chat_id`:
```bash
TOKEN="your_bot_token"
curl https://api.telegram.org/bot$TOKEN/getUpdates
```
## License
This project is Licensed under the [MIT License](LICENSE).