Download the PHP package onamfc/laravel-devlogger without Composer
On this page you can find all versions of the php package onamfc/laravel-devlogger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onamfc/laravel-devlogger
More information about onamfc/laravel-devlogger
Files in onamfc/laravel-devlogger
Package laravel-devlogger
Short Description A custom logging package for Laravel with database storage and automatic error catching
License MIT
Informations about the package laravel-devlogger
A comprehensive logging package for Laravel that stores logs in a database with automatic error catching, advanced filtering, and management capabilities.
Features
- Database Logging: Store logs in database with rich metadata
- Automatic Error Catching: Automatically capture and log all application exceptions
- Tagging System: Organize logs with custom tags
- Advanced Filtering: Filter logs by level, date, queue, status, and more
- Automatic Cleanup: Configurable log retention with automatic cleanup
- Queue Support: Associate logs with specific queues
- Request Context: Capture HTTP request information automatically
- User Tracking: Track which user triggered each log entry
- Flexible Configuration: Extensive configuration options via environment variables
Installation
1. Install via Composer
2. Publish Configuration and Migrations
3. Run Migrations
4. Configure Environment Variables (Optional)
Add these to your .env file to customize behavior:
Basic Usage
Manual Logging
Exception Logging
Automatic Exception Catching - Laravel 9, 10, 11
The package automatically catches and logs all unhandled exceptions when DEVLOGGER_AUTO_CATCH=true (default). To set
this up:
Option 1: Extend the DevLogger Exception Handler
In your app/Exceptions/Handler.php:
Option 2: Manual Integration
If you prefer to keep your existing handler, add this to your report method:
Automatic Exception Catching - Laravel 12
Integration
The bootstrap directory contains the app.php file which bootstraps the framework: bootstrap/app.php. Within the
withException method, you can integrate the DevLogger package to automatically catch exceptions:
Advanced Usage
Working with Log Models
Log Cleanup
The package includes automatic cleanup based on your retention policy:
Automatic cleanup runs daily when DEVLOGGER_RETENTION_DAYS is configured.
Database Schema
The developer_logs table includes these fields:
| Field | Type | Description |
|---|---|---|
id |
bigint | Primary key |
level |
string | Log level (debug, info, error, etc.) |
log |
longtext | The log message |
context |
json | Additional context data |
file_path |
string | File where log originated |
line_number |
integer | Line number where log originated |
exception_class |
string | Exception class name (for exceptions) |
stack_trace |
longtext | Full stack trace (for exceptions) |
queue |
string | Associated queue name |
request_url |
string | HTTP request URL |
request_method |
string | HTTP request method |
user_id |
bigint | ID of authenticated user |
ip_address |
string | Client IP address |
user_agent |
text | Client user agent |
status |
string | Log status (open/closed) |
tags |
json | Array of tags |
updated_by |
bigint | User who last updated the log |
created_at |
timestamp | When log was created |
updated_at |
timestamp | When log was last updated |
deleted_at |
timestamp | Soft delete timestamp |
Configuration Options
The config/devlogger.php file provides extensive configuration:
Performance Considerations
- The package uses database indexes for optimal query performance
- Automatic cleanup prevents database bloat
- Failed database writes fall back to Laravel's default logging
- Excluded paths prevent logging of framework internals
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This package is open-sourced software licensed under the MIT license.
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
All versions of laravel-devlogger with dependencies
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0