Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
grkamil committed Sep 19, 2018
1 parent 168299b commit 89d64d9
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# laravel-telegram-logging
# Laravel Telegram logger

Send logs to Telegram chat via Telegram bot

## Install

```
composer require grkamil/laravel-telegram-logger
```

Define Telegram Bot Token and chat id (users telegram id) and set as environment parameters.
Add to <b>.env</b>

```
TELEGRAM_LOGGER_BOT_TOKEN=id:token
TELEGRAM_LOGGER_CHAT_ID=chat_id
```


Add to <b>config/logging.php</b> file new channel:

```php
'telegram' => [
'driver' => 'custom',
'via' => Logger\TelegramLogger::class,
'level' => 'debug',
]
```

If your default log channel is a stack, you can add it to the <b>stack</b> channel like this
```php
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'telegram'],
]
```

Or you can simply change the default log channel in the .env
```
LOG_CHANNEL=telegram
```

## Create bot

For using this package you need to create Telegram bot

1. Go to @BotFather in the Telegram
2. Send ``/newbot``
3. Set up name and bot-name for your bot.
4. Get token and add it to your .env file (it is written above)
5. Go to your bot and send ``/start`` message

0 comments on commit 89d64d9

Please sign in to comment.