Download the PHP package aledaas/loggerdb without Composer
On this page you can find all versions of the php package aledaas/loggerdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aledaas/loggerdb
More information about aledaas/loggerdb
Files in aledaas/loggerdb
Package loggerdb
Short Description DB-based process logging and email alerting for Laravel apps.
License MIT
Informations about the package loggerdb
LoggerDB for Laravel
DB-based process logging + email alerts.
Install (local path in monorepo)
In your app's root composer.json, add:
Installation via Packagist
You can install LoggerDB using Composer by running:
LoggerDB supports Laravel versions 8.x, 9.x, and 10.x.
Configuration
To publish the configuration file, run:
This will create a config/loggerdb.php file where you can customize the package settings:
enabled(bool): Enable or disable logging and email alerts.levels(array): The log levels to record and send alerts for (e.g.['error', 'warning', 'critical']).emails(array): Email addresses to receive alert notifications.dedup_seconds(int): Number of seconds to deduplicate alerts to avoid spamming.
Database Migration
Run the package migrations to create the necessary tables:
Or, if you prefer to run only the package migrations:
Usage
You can log processes using the ProcessLog model. Here is an example:
Fields explained:
process: Identifier for the process being logged.step: Specific step or phase within the process.level: Severity level of the log entry.outcome: Result status of the step.message: Human-readable description.context: JSON-serializable array with extra metadata.
Email Alerts
If logging is enabled and the log level or outcome matches the configured criteria, LoggerDB will send alert emails to the addresses specified in the configuration. Alerts are deduplicated based on the dedup_seconds setting to prevent email spamming.
License
LoggerDB is open source software licensed under the MIT License.