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

v1.0.0 2025-12-07 07:09 UTC

This package is auto-updated.

Last update: 2025-12-07 07:18:55 UTC


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