Download the PHP package riodwanto/filament-logger without Composer
On this page you can find all versions of the php package riodwanto/filament-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download riodwanto/filament-logger
More information about riodwanto/filament-logger
Files in riodwanto/filament-logger
Package filament-logger
Short Description Activity logger for filament
License MIT
Homepage https://github.com/riodwanto/filament-logger
Informations about the package filament-logger
Activity Logger for Filament
A comprehensive activity logging solution for Filament applications, powered by spatie/laravel-activitylog. Track user actions, model changes, and system events with a beautiful, configurable interface.
Features
- 📊 Comprehensive Logging: Track Filament Resource events, user logins, notifications, and custom model events
- 🎨 Beautiful Interface: Clean, responsive UI with advanced filtering and search capabilities
- 🌍 Multi-language Support: Available in 19+ languages with easy translation publishing
- ⚙️ Highly Configurable: Enable/disable specific loggers, customize colors, and configure retention
- 🔍 Advanced Filtering: Filter by date range, user, event type, and property changes
- 🏢 Multi-tenant Support: Built-in support for Filament's multi-tenancy features
- 📱 Mobile Responsive: Optimized for all device sizes
- 🔧 Extensible: Easy to extend with custom loggers and events
What Gets Logged
By default, this package logs:
- Resource Events: Create, update, delete operations on Filament Resources
- Access Events: User login/logout activities with IP and user agent
- Notification Events: Sent and failed notification attempts
- Model Events: Custom model changes (when configured)
Note: If you want to log models that are not Filament Resources, you'll need to manually register them in the configuration file.
Installation
This package uses spatie/laravel-activitylog, instructions for its setup can be found here
Requirements
- PHP 8.1 or higher
- Laravel 8.0 or higher
- Filament 3.x
Installation
-
Install the package via Composer:
- Run the installation command:
This command will:
- Publish the configuration file
- Publish migrations from
spatie/laravel-activitylog - Set up the necessary database tables
-
Run the migrations:
- Register the Activity Resource in your Panel Provider:
Quick Start
After installation, you'll immediately see activity logs for:
- All Filament Resource operations (create, update, delete)
- User login events
- Notification events
Navigate to your Filament admin panel and look for the "Activity Log" menu item to view the logs.
Configuration
The package is highly configurable through the config/filament-logger.php file. Here are the main configuration options:
Basic Configuration
Logger Configuration
Resource Logger
Access Logger
Notification Logger
Model Logger
Custom Loggers
You can create custom loggers for specific events:
Customization
Creating Custom Loggers
Create a custom logger by extending the AbstractModelLogger:
Excluding Resources from Logging
To exclude specific resources from being logged:
Customizing Navigation
Customizing Date Formats
Advanced Features
Multi-tenant Support
The package supports Filament's multi-tenancy out of the box. Set scoped_to_tenant to true in your config to enable tenant-scoped activity logs.
Advanced Filtering
The activity log interface includes powerful filtering options:
- Date Range: Filter logs by creation date range
- Event Type: Filter by specific events (created, updated, deleted, etc.)
- User: Filter by specific user ID
- Subject Type: Filter by model type
- Property Changes: Search within old/new values
Export Functionality
You can easily add export functionality by extending the ActivityResource:
Troubleshooting
Common Issues
Activity Logs Not Appearing
- Ensure the ActivityResource is registered in your PanelProvider
- Check that the migrations have been run
- Verify that the loggers are enabled in the config
Missing Translation Keys
If you see missing translation keys, publish the translations:
Performance Issues
For high-traffic applications:
- Consider disabling certain loggers
- Implement log rotation
- Use database indexing on frequently queried columns
Multi-tenant Issues
If logs aren't scoped correctly:
- Verify
scoped_to_tenantsetting - Ensure your tenant model is properly configured
- Check that the Activity model uses the correct tenant relationship
Debug Mode
Enable debug mode to see detailed logging information:
Authorization
To enforce policies on ActivityResource, after generating a policy, you would need to register Spatie\Activitylog\Models\Activity to use that policy in the AuthServiceProvider.
If you are using Shield just register the ActivityPolicy generated by it
Translations
Publish the translations using:
Activity Model resolution
The main Activity class being used by the Filament Resource instance will be resolved by Spatie's service provider, which loads the model defined by the configuration key found at activitylog.activity_model in config/activitylog.php.
Screenshots
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ziyaan Hassan - Original Author
- Rio Dwanto - Current Maintainer
- Spatie Activitylog Contributors
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Support
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Search existing GitHub Issues
- Create a new issue with detailed information about your problem
Contributing
We welcome contributions! Please see our Contributing Guide for details on how to:
- Report bugs
- Suggest new features
- Submit pull requests
- Follow our coding standards
Changelog
Please see CHANGELOG for more information on what has changed recently.
Upgrade Guide
From Original Package (z3d0x/filament-logger)
If you're upgrading from the original package:
-
Update Composer dependency:
-
Update namespace references (if any):
- Change
Z3d0X\FilamentLoggertoRiodwanto\FilamentLogger
- Change
-
Clear caches:
- Test your application to ensure everything works correctly
The API remains largely the same, so most applications should work without changes.
All versions of filament-logger with dependencies
filament/filament Version ^3.0
illuminate/contracts Version ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0
spatie/laravel-activitylog Version ^4.5
spatie/laravel-package-tools Version ^1.13.5