obd / logtracker
User activity log manager. All kind of database activity will be tracked
Package info
github.com/RonyKader/logtracker
Language:JavaScript
Type:package
pkg:composer/obd/logtracker
README
A high-performance, internationalized activity log manager for Laravel applications. This package tracks all database activities and provides a premium, animated audit panel.
Features
- Premium UI: Glassmorphic, React-powered dashboard with 30-Day Activity Heatmaps and interactive Date Range Picker.
- Log Management: Full-featured System Log Viewer with support for multiple files (daily logs), entry deletion, and bulk clearing.
- i18n Ready: Full support for English and Bengali locales.
- Granular Security: Access control via User ID whitelisting.
- Performance: Asynchronous logging support via Laravel Queues and Optimized Batch Pruning.
- NoSQL Backup: Background synchronization of logs to MongoDB.
- Privacy: Automatically masks sensitive
$hiddenattributes.
Installation
Local Development
Add the path to your composer.json:
"repositories": [ { "type": "path", "url": "./Packages/logtracker" } ]
Then run:
composer require obd/logtracker:dev-master
Setup
-
Publish Assets:
php artisan vendor:publish --tag=logtracker-config --force php artisan vendor:publish --tag=logtracker-views --force
-
Run Migrations:
php artisan migrate
-
Add Trait to Models: Automatically add the tracking trait to all your models:
php artisan logtracker:install-trait
Alternatively, manually add to specific models:
use Obd\Logtracker\Traits\Logtrackerable; class Project extends Model { use Logtrackerable; }
Configuration (.env)
Authorization
By default, the audit panel is restricted. Add allowed User IDs:
LOGTRACKER_ALLOWED_IDS=1,2,5
Performance & Features
# Performance LOGTRACKER_QUEUE_ENABLED=true # MongoDB Sync LOGTRACKER_MONGO_ENABLED=true LOGTRACKER_MONGO_CONNECTION=mongodb # Data Retention LOGTRACKER_RETENTION_DAYS=90
Synchronize logs to MongoDB:
php artisan logtracker:sync-mongo
Install Trait Automatically:
Scan your model directory and inject the Logtrackerable trait:
php artisan logtracker:install-trait
# Preview changes without modifying files:
php artisan logtracker:install-trait --dry-run
Prune Stale Logs:
Keep your database lean by removing logs older than the configured retention period:
php artisan logtracker:prune
# Or override the default retention
php artisan logtracker:prune --days=30
Automated Maintenance
It is highly recommended to schedule the pruning command:
$schedule->command('logtracker:prune')->daily();
Updating
When updating the package to a new version, always run the following to sync the latest UI assets:
composer update obd/logtracker php artisan vendor:publish --tag=logtracker-assets --force php artisan optimize:clear