Download the PHP package kaoken/laravel-mysql-email-log without Composer
On this page you can find all versions of the php package kaoken/laravel-mysql-email-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-mysql-email-log
laravel-mysql-email-log
Save logs handled by Laravel in Mysql, and send mail when it is over specified level.
Table of content
- Install
- Setting
- Event
- License
Install
composer:
or, add composer.json
Setting
Add to config\app.php
as follows:
Add to config\database.php
as follows:
Copy the above ['connections']['mysql']
and set the driver name to mysql_log
.
This is necessary to prevent the log from being lost due to rollback after writing
the log when doing transaction processing (DB :: transaction
,DB :: beginTransaction
etc.)
with the driver name mysql
.
Add to config\logging.php
as follows:
driver
is amonolog
.handler
is aKaoken\LaravelMysqlEmailLog\LaravelMysqlEmailLogHandler::class
.model
is a log model.email
sends a mail according toemail_send_level
if it istrue
. In case offalse
, do not send anything.email_send_level
specifies the log level and send from the specified log level or higher. Since the priority is low,DEBUG
、INFO
、NOTICE
、WARNING
、ERROR
、CRITICAL
、ALERT
、EMERGENCY
.Capital letters and lower case letters are not distinguished.email_log
should modify the class derived from Mailable as necessary. Send log mail.email_send_limit
should modify the class derived from Mailable as necessary. Send when e-mail transmission limitmax_email_send_count
is exceeded.max_email_send_count
, the log e-mail that can be transmitted in one day. A simple warning mail is sent when the number exceeds the number of transmissions. Seeemail_send_level
.to
is the destination of the mail.
Modify .env
to enable logging
Make corrections as follows
Command
After execution, the following directories and files are added.
database
migrations
2017_09_17_000001_create_logs_table.php
resources
views
vendor
mysql_email_log
log.blade.php
over_limit.blade.php
Migration
Migration file 2017_09_17_000001_create_logs_table.php
should be modified as necessary.
In the configuration config\logging.php
of the above setting,
The Kaoken\LaravelMysqlEmailLog\Mail\ConfirmationMailToUser::class
of email_log
is used as the log mail of the target level or higher.
The template uses views\vendor\mysql_email_log\log.blade.php
. Change according to the specifications of the application.
The Kaoken\LaravelMysqlEmailLog\Mail\ConfirmationMailToUser::class
of email_send_limit
is used when the log above the target level reaches the send limit.
The template uses views\vendor\mysql_email_log\over_limit.blade.php
. Change according to the specifications of the application.
Event
See inside the vendor\laravel-mysql-email-log\src\Events
directory!
BeforeWriteLogEvent
Called before writing the log.