承接 milly/laralog 相关项目开发

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

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

milly/laralog

最新稳定版本:1.0.3

Composer 安装命令:

composer require milly/laralog

包简介

PHP package to handle logs via telegram bot

README 文档

README

PHP Laravel package to debug and handle logs via telegram bot

License Packagist Version Packagist Version

Requirements

Installation

Install the package via composer

composer require milly/laralog

Publish the configuration file

 php artisan vendor:publish --tag=laralog-config

Add the following environment variables to your .env file or set them in the config/laralog.php file

TELEGRAM_BOT_TOKEN=1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ
TELEGRAM_CHAT_ID=-1234567890

Methods

The package provides the following methods to send log messages to the telegram bot

  • Laralog::debug(int|string|array|object $message)
  • Laralog::info(int|string|array|object $message)
  • Laralog::warning(int|string|array|object $message)
  • Laralog::error(int|string|array|object $message)

Usage

Send a log message to the telegram bot

use Milly\Laralog\Laralog;

// call statically
Laralog::debug('This is a debug message');

//call instance
$laralog = new Laralog();
$laralog->info('This is an info message');

And you will receive a message in your telegram bot with the debug message like this:

Development mode

By default, the package is in the development mode, which means that it will send messages only if the APP_ENV is set to local. If you want to send messages in the production mode, you need to set the is_enabled key to true in the config/laralog.php file

return [
    'is_enabled' => true,
    'telegram_bot_token' => env('TELEGRAM_BOT_TOKEN'),
    'telegram_chat_id' => env('TELEGRAM_CHAT_ID'),
];

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-28