A tool for storing log information in MySQL DB with some necessary information.
- User ID
- User IP
- User Input (Optional)
- URL
- HTTP Method
- Log Level
- Log Message
- Stack Trace (Optional)
- Request Referrer/Origin
-
To install LogRhythm, run the following command:
composer require farhad/log-rhythm
-
For Laravel version > 5.5 'ServiceProvider' will be automatically added.
-
Run the command below to load all configuration file:
php artisan vendor:publish --provider="Farhad\LogRhythm\LogRhythmServiceProvider"
-
After publishing update your configuration to choose this package for logging. To change the logging channel to LogRhythm add
logrhythm
in the channels array onconfig/logging.php
:protected $channels = [ ... ... ... ... ... ... ... ... ... ... 'logrhythm' => [ 'driver' => 'custom', 'via' => \Farhad\LogRhythm\LogRhythmChannel::class, ], ];
-
Run the command below to migrate database table:
php artisan migrate
-
Update your
.env
( If you cache yourenv
then clear cache to load new settings byphp artisan config:cache
):LOG_CHANNEL=logrhythm
-
You can control the logging information by updating
config/logrhythm.php
file.
LogRhythm is free software distributed under the terms of the MIT license.