Download the PHP package codexpedite/laravel-supabase-logger without Composer
On this page you can find all versions of the php package codexpedite/laravel-supabase-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codexpedite/laravel-supabase-logger
More information about codexpedite/laravel-supabase-logger
Files in codexpedite/laravel-supabase-logger
Package laravel-supabase-logger
Short Description A modular Laravel package for logging to Supabase with deduplication, tagging, and occurrence tracking
License MIT
Homepage https://github.com/codeXpedite/laravel-supabase-logger
Informations about the package laravel-supabase-logger
Laravel Supabase Logger
A powerful, modular Laravel package for logging to Supabase (PostgreSQL) with advanced features including deduplication, occurrence tracking, smart tagging, and batch processing.
Features
- 🔄 Log Deduplication: Automatically deduplicates identical log messages using MD5 hashing
- 📊 Occurrence Tracking: Counts how many times each unique log has occurred
- 🏷️ Smart Auto-Tagging: Automatically tags logs based on routes, users, exceptions, and context
- 📦 Batch Processing: Efficiently processes logs in configurable batches to optimize API usage
- 🔄 Fallback Logging: Graceful error handling with automatic fallback to local file logging
- ⚡ High Performance: Built with performance in mind using efficient HTTP client with retry logic
- 🛠️ Management Commands: Artisan commands for testing, flushing, and tailing logs
- 🔒 Security: Configurable sensitive data sanitization
- 🎯 Production Ready: Robust error handling and comprehensive logging
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x
- Supabase project with PostgreSQL database
Installation
Install the package via Composer:
Publish the configuration file:
Database Setup
Create the laravel_logs table in your Supabase database:
Configuration
Add your Supabase credentials to your .env file:
Add the Supabase logging channel to your config/logging.php:
Basic Usage
Management Commands
Test Connection
Test your Supabase connection and configuration:
View Recent Logs
Display recent logs from Supabase:
Force Flush Logs
Force flush any pending logs from memory buffer:
Configuration Options
The package provides extensive configuration options in config/supabase-logger.php:
Features in Detail
Log Deduplication
The package automatically deduplicates identical log messages using MD5 hashing. When a duplicate log is detected:
- The
occurrencescount is incremented - The
last_occurred_attimestamp is updated - No new database row is created
Smart Auto-Tagging
Logs are automatically tagged based on:
- Route:
route:user.profile - User:
user:123(when authenticated) - Exception:
exception:ValidationException - IP Address:
ip:192.168.1.1 - Custom Tags: Via context
tagsarray
Batch Processing
Logs are collected in memory and sent in configurable batches to reduce API calls and improve performance.
Error Handling & Fallback
If Supabase is unavailable, the package will:
- Attempt to retry the request (configurable retry attempts)
- Fall back to local file logging if enabled
- Log errors to Laravel's default log channel
- Continue operation without breaking your application
Model Usage
Interact with logs using the provided Eloquent model:
Testing
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to [email protected].
Credits
- CodeXpedite
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Support
Made with ❤️ by CodeXpedite
All versions of laravel-supabase-logger with dependencies
laravel/framework Version ^10.0|^11.0|^12.0
monolog/monolog Version ^3.0
guzzlehttp/guzzle Version ^7.0