tyea/redlog

A Laravel package for writing log messages to a MySQL, PostgreSQL, SQLite, or SQL Server database

Installs: 346

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/tyea/redlog

1.0.3 2020-05-08 17:28 UTC

This package is auto-updated.

Last update: 2025-10-09 05:10:48 UTC


README

About

Red Log is a Laravel package for writing log messages to a MySQL, PostgreSQL, SQLite, or SQL Server database.

Requirements

  • PHP >= 7.0
  • Laravel >= 5.5

Installation

composer require tyea/redlog

Usage

Update your .env and .env.example files:

LOG_CHANNEL=database
LOG_TABLE=logs

Update your config/logging.php file:

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

Run these commands:

php artisan log:table
php artisan migrate

Update your app/Console/Kernel.php file:

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

Author

Written by Tom Yeadon in April 2020.