承接 confetticode/laravel-log 相关项目开发

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

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

confetticode/laravel-log

最新稳定版本:v0.2.0

Composer 安装命令:

composer require confetticode/laravel-log

包简介

Integrate multi log channels with Laravel

README 文档

README

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via composer:

composer require confetticode/laravel-log

Usage

Configure your environment variables:

LOG_MAIL_DRIVER=smtp
LOG_MAIL_LEVEL=error
LOG_MAIL_FROM=internal@confetticode.com
LOG_MAIL_TO=devops@confetticode.com

LOG_TELEGRAM_LEVEL=error
LOG_TELEGRAM_API_KEY=1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOG_TELEGRAM_CHAT_ID="@channel_or_group_id"

Send a log entry to mail or telegram:

# Sending a log entry via mail.
Log::channel('mail')->error('Test mail log channel.');

# Sending a log entry via telegram.
Log::channel('telegram')->error('Test telegram log channel.');

You may want to update the config/logging.php to push telegram and mail channels in the stack:

<?php
return [
   'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'telegram', 'mail'],
            'ignore_exceptions' => false,
        ],
     ],
];

You may use mail and telegram log drivers however you want. Please read the logging.php to know about their configuration!

License (MIT)

The confetticode/laravel-log package is licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-19