tyea/redlog

一个用于将日志消息写入MySQL、PostgreSQL、SQLite或SQL Server数据库的Laravel包

1.0.3 2020-05-08 17:28 UTC

This package is auto-updated.

Last update: 2024-09-09 02:51:45 UTC


README

关于

Red Log是一个用于将日志消息写入MySQL、PostgreSQL、SQLite或SQL Server数据库的Laravel包。

需求

  • PHP >= 7.0
  • Laravel >= 5.5

安装

composer require tyea/redlog

使用

更新您的.env.env.example文件

LOG_CHANNEL=database
LOG_TABLE=logs

更新您的config/logging.php文件

"database" => [
	"driver" => "monolog",
	"handler" => "Tyea\\RedLog\\DatabaseHandler",
	"table" => env("LOG_TABLE", "logs")
]

运行以下命令

php artisan log:table
php artisan migrate

更新您的app/Console/Kernel.php文件

$schedule->command("log:clear")->daily();

作者

由Tom Yeadon于2020年4月编写。