yiisoft/log-target-email 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

yiisoft/log-target-email

Composer 安装命令:

composer require yiisoft/log-target-email

包简介

Yii Logging Library - Email Target

README 文档

README

Yii

Yii Logging Library - Email Target


Latest Stable Version Total Downloads Build status Code Coverage Mutation testing badge static analysis type-coverage

This package provides the Email target for the yiisoft/log library.

Requirements

  • PHP 8.1 - 8.5.

Installation

The package could be installed with Composer:

composer require yiisoft/log-target-email

General usage

Creating a target:

$emailTarget = new \Yiisoft\Log\Target\Email\EmailTarget($mailer, $emailTo, $subjectEmail, $levels);
  • $mailer (\Yiisoft\Mailer\MailerInterface) - The mailer instance that sends email and should be already configured.
  • $emailTo (string|array) - The receiver email address. You may pass an array of addresses if multiple recipients should receive this message. You may also specify receiver name in addition to email address using format: [email => name].
  • $subjectEmail (string) - The email message subject. Defaults to Application Log.
  • $levels (array) - Optional. The log message levels that this target is interested in. Defaults to [] (all levels). For example: [LogLevel::ERROR, LogLevel::WARNING].

Example with level filtering:

use Psr\Log\LogLevel;

// Only log ERROR and WARNING messages
$emailTarget = new \Yiisoft\Log\Target\Email\EmailTarget(
    $mailer, 
    'admin@example.com', 
    'Application Errors',
    [LogLevel::ERROR, LogLevel::WARNING]
);

Creating a logger:

$logger = new \Yiisoft\Log\Logger([$emailTarget]);

For use in the Yii framework, see the configuration files:

Documentation

For a description of using the logger, see the yiisoft/log package.

If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.

License

The Yii Logging Library - Email Target is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 13
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2019-04-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固