An easy way to use the official Elastic Search client for auditlog in your Laravel applications.
Install the current version of the hsnbd/auditlog
package via composer:
composer require hsnbd/auditlog
After install, Laravel will automatically register The package's service provider.
Publish the configuration file:
php artisan vendor:publish --provider="Hsnbd\AuditLogger\AuditLoggerServiceProvider"
hsnbd/auditlog
use laravel default queue.
php artisan queue:table
php artisan migrate
The AuditLog
facade is used for logging. In order to use that.
\Hsnbd\AuditLogger\AuditLog::info('Hello World');
\Hsnbd\AuditLogger\AuditLog::debug('Hello World');
This command must run always.
php artisan queue:work database --queue=listeners
Please see Available Commands section before start.
Some useful console commands.
For Bootstrap basic setup for ELK stack
php artisan auditlog:bootstrap
Test auditlog if it is working or not.
php artisan auditlog:test
If you want to track every step of laravel model, you can set it using.
class ABCModel extends Model implements \Hsnbd\AuditLogger\Interfaces\ShouldAuditLog {}
So you don't have to do anything after that.
Thanks to everyone who has contributed to this project!
Please see CONTRIBUTING.md to contribute.
If you found any bugs, Please report it using Github
Baker Hasan ๐ง Email Me
This project is licensed under the MIT License - see the License File.