peroxovy/laravel-mail-logging
最新稳定版本:v0.0.5
Composer 安装命令:
composer require peroxovy/laravel-mail-logging
包简介
Package which allows to send logs to e-mail.
README 文档
README
This package provides possibility to send an exception to desired e-mail addresses, notifying the administrator about any problems.
Installation:
composer require peroxovy/laravel-mail-logging
Publish config:
php artisan vendor:publish --provider="Peroxovy\LaravelMailLogging\Providers\MailLoggingServiceProvider"
Add the following lines to your .env:
MAIL_LOG_FROM={email address from}
MAIL_LOG_TO={email addresses divided by "," }
MAIL_LOG_SUBJECT={email subject}
MAIL_LOG_MEMORY_USAGE=true/false
MAIL_LOG_MEMORY_PEAK=true/false
MAIL_LOG_WEB=true/false
MAIL_LOG_GIT=true/false
Modify channels section inside your config/logging.php by adding the driver:
'mail' => [ 'driver' => 'custom', 'via' => \Peroxovy\LaravelMailLogging\MailLogger::class, 'from' => env('MAIL_LOG_FROM', 'no-reply@example.com'), 'to' => explode(',', env('MAIL_LOG_TO', 'admin@example.com')), 'level' => env('MAIL_LOG_LEVEL', 'error'), 'subject' => env('MAIL_LOG_SUBJECT', 'This is a subject of a Log'), 'processors' => [ 'memory_usage' => env('MAIL_LOG_MEMORY_USAGE', true), 'memory_peak' => env('MAIL_LOG_MEMORY_PEAK', true), 'web' => env('MAIL_LOG_WEB', true), 'git' => env('MAIL_LOG_GIT', true), ], ],
Activate the package by modifying your default log channel:
'stack' => [ 'driver' => 'stack', 'channels' => ['daily', 'mail'], 'ignore_exceptions' => false, ],
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-16