michael-orenda / logging
Unified hybrid logging package (activity, security, and error logs) for Laravel applications.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/michael-orenda/logging
Requires
- php: >=8.2
- illuminate/database: ^12.0
- illuminate/support: ^12.0
README
Unified Activity, Security & Error Logging for Laravel (Hybrid Architecture)
This package provides a clean, modular logging system for Laravel applications, featuring:
- Activity logs (CRUD actions, workflow events, system events)
- Security logs (authentication, authorization, threat detection)
- Error logs (exceptions, failures, runtime errors)
- Unified logging facade:
Logger::activity(),Logger::security(),Logger::error() - Global helper functions:
log_activity(),log_security(),log_error() - Configurable log retention
- Pruning command (
logging:prune) - Designed for integration with Notification + Error Manager packages
๐ Installation
composer require michael-orenda/logging
If using a local path repository during development:
"repositories": [ { "type": "path", "url": "../logging" } ]
Then:
composer require michael-orenda/logging:@dev
Laravel will auto-discover the service provider.
๐ฆ Publish Config (optional)
php artisan vendor:publish --tag=config
๐ข Run Migrations
php artisan migrate
๐ฅ Usage
Activity Logging
Logger::activity('record_created', ['id' => 10]);
Or helper:
log_activity('record_created', ['id' => 10]);
Security Logging
Logger::security('login_failed', ['ip' => request()->ip()]);
Error Logging
Logger::error('exception_thrown', ['message' => 'Something broke']);
๐งน Pruning Old Logs
php artisan logging:prune
Override:
php artisan logging:prune --days=30
Prune specific types:
php artisan logging:prune --activity
โฑ Schedule It
Add to app/Console/Kernel.php:
protected function schedule(Schedule $schedule) { $schedule->command('logging:prune')->daily(); }
๐ License
MIT