1- Laravel Mail Logger
2- ===============
1+ # Laravel Mail Log Channel
2+
33
44[ ![ Latest Stable Version] ( https://img.shields.io/github/v/release/shaffe-fr/laravel-mail-log-channel.svg )] ( https://packagist.org/packages/shaffe/laravel-mail-log-channel ) [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/shaffe/laravel-mail-log-channel.svg )] ( https://packagist.org/packages/shaffe/laravel-mail-log-channel )
55[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
@@ -10,30 +10,27 @@ This package is a fork of [laravel-log-mailer](https://packagist.org/packages/de
1010
1111![ image] ( https://user-images.githubusercontent.com/12199424/45576336-a93c1300-b86e-11e8-9575-d1e4c5ed5dec.png )
1212
13+ ## Table of contents
1314
14- Table of contents
15- -----------------
1615* [ Installation] ( #installation )
1716* [ Configuration] ( #configuration )
1817
19- Installation
20- ------------
18+ ## Installation
2119
2220You can install this package via composer using this commande:
2321
2422``` sh
2523composer require shaffe/laravel-mail-log-channel
2624```
2725
28-
29- ### Laravel version Compatibility
26+ ### Laravel version compatibility
3027
3128 Laravel | Package |
3229:---------|:--------|
33- 7.x | 1.1.x |
34- 6.x | 1.1.x |
35- 5.6.x | 1.0.x |
36-
30+ 7.x | ^2.0 |
31+ 6.x | ^2.0 |
32+ 5.6.x | ^ 1.0 |
33+
3734The package will automatically register itself if you use Laravel.
3835
3936For usage with [ Lumen] ( http://lumen.laravel.com ) , add the service provider in ` bootstrap/app.php ` .
@@ -42,15 +39,16 @@ For usage with [Lumen](http://lumen.laravel.com), add the service provider in `b
4239$app->register(Shaffe\MailLogChannel\MailLogChannelServiceProvider::class);
4340```
4441
45- Configuration
46- ------------
42+ ## Configuration
4743
4844To ensure all unhandled exceptions are mailed:
4945
50461 . create a ` mail ` logging channel in ` config/logging.php ` ,
51472 . add this ` mail ` channel to your current logging stack,
52483 . add a ` LOG_MAIL_ADDRESS ` to your ` .env ` file to define the recipient.
5349
50+ You can specify multiple channels and individually change the recipients, the subject and the email template.
51+
5452``` php
5553'channels' => [
5654 'stack' => [
@@ -66,21 +64,23 @@ To ensure all unhandled exceptions are mailed:
6664 'driver' => 'mail',
6765 'level' => env('LOG_MAIL_LEVEL', 'notice'),
6866
69- // Specify who to mail the log to
67+ // Specify mail recipient
7068 'to' => [
7169 [
7270 'address' => env('LOG_MAIL_ADDRESS'),
73- 'name' => 'Error'
74- ]
71+ 'name' => 'Error',
72+ ],
7573 ],
7674
7775 'from' => [
76+ // Defaults to config('mail.from.address')
7877 'address' => env('LOG_MAIL_ADDRESS'),
78+ // Defaults to config('mail.from.name')
7979 'name' => 'Errors'
8080 ],
8181
8282 // Optionally overwrite the subject format pattern
83- 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'),
83+ // 'subject_format' => env('LOG_MAIL_SUBJECT_FORMAT', '[%datetime%] %level_name%: %message%'),
8484
8585 // Optionally overwrite the mailable template
8686 // Two variables are sent to the view: `string $content` and `array $records`
@@ -89,6 +89,8 @@ To ensure all unhandled exceptions are mailed:
8989],
9090```
9191
92+ ### Recipients configuration format
93+
9294The following ` to ` config formats are supported:
9395
9496* single email address:
@@ -103,13 +105,13 @@ The following `to` config formats are supported:
103105 'to' => explode(',', env('LOG_MAIL_ADDRESS', '')),
104106 ```
105107
106- * associative array of email/ name addresses:
108+ * associative array of email => name addresses:
107109
108110 ```php
109111 'to' => [env('LOG_MAIL_ADDRESS', '') => 'Error'],`
110112 ```
111113
112- * an array of email and name:
114+ * array of email and name:
113115
114116 ```php
115117 'to' => [
@@ -119,5 +121,3 @@ The following `to` config formats are supported:
119121 ],
120122 ],
121123 ```
122-
123- You can specify multiple channels and change the recipients and customize the email template per channel.
0 commit comments