Laravel model & request logging

1.6.1 2024-06-01 22:24 UTC

This package is auto-updated.

Last update: 2024-06-01 15:30:13 UTC


Package designed to enhance Laravel application's logging capabilities. It offers a robust solution for tracking and logging various model and application events.

  • Model Logging
  • Request Logging
  • Support MongoDB


composer require nhattuanbl/syslog

Important: With version 5.4 or below, you must register your service providers manually in the providers section of the config/app.php configuration file in your laravel project.

'providers' => [
    // Other Service Providers


Publish config file

php artisan vendor:publish --provider="nhattuanbl\Syslog\SyslogServiceProvider" --tag="config"

Publish migration file

php artisan vendor:publish --provider="nhattuanbl\Syslog\SyslogServiceProvider" --tag="migration"
php artisan migrate


Tracking Model Events


namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use nhattuanbl\Syslog\Traits\SyslogTrait;

class Product extends Model
    use SyslogTrait;

Custom log

use nhattuanbl\Syslog\Models\Syslog;

Syslog::log('auth', 'someone login', 'login', null, null, ['ip' => $request->ip()]);