承接 thanhtaivtt/laravel-telegram-logger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thanhtaivtt/laravel-telegram-logger

Composer 安装命令:

composer require thanhtaivtt/laravel-telegram-logger

包简介

Laravel Send error log to Telegram Bot, Channel

README 文档

README

Send Laravel log to Telegram Bot or Channel

Install

composer require thanhtaivtt/laravel-telegram-logger

Config

  • Add this code to the config/logging.php as a new channel:
'telegram' => [
            'driver' => 'custom',
            'via' => \Thanhtaivtt\TelegramLogger\TelegramLogger::class,
            'api_key' => env('TELEGRAM_API_KEY'),
            'chat_id' => env('TELEGRAM_CHAT_ID'),
            'send_log' => env('TELEGRAM_SEND_LOG', false),
        ],
  • And add telegram channel to current stack channel:

Eg:

'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'telegram'],
            'ignore_exceptions' => false,
        ],
  • Define Telegram Bot Token and chat id on .env
TELEGRAM_API_KEY=BOT_TOKEN
TELEGRAM_CHAT_ID=BOT_ID
TELEGRAM_SEND_LOG=true

Description

Key Type Description
TELEGRAM_API_KEY String Token of Telegram Bot or Channel
TELEGRAM_CHAT_ID String Bot or Channel ID (Include the @ character)
TELEGRAM_SEND_LOG Boolean Specify whether to send the log or not

If you want to send the log in all other than local environments, you can set it as follows:

'telegram' => [
            'driver' => 'custom',
            'via' => \Thanhtaivtt\TelegramLogger\TelegramLogger::class,
            'api_key' => env('TELEGRAM_API_KEY'),
            'chat_id' => env('TELEGRAM_CHAT_ID'),
            'send_log' => env('APP_ENV') !== 'local',
        ],

How to create Telegram Bot?

Laravel Telegram Logger

统计信息

  • 总下载量: 326
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固