Skip to content

Commit 8bcac4c

Browse files
committed
Merge branch 'master' of github.com:adamcrampton/laravel-database-logger
2 parents 627e335 + cfb1fad commit 8bcac4c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ Laravel logs to database table via custom Monolog channel + Eloquent model.
2626
'via' => \AdamCrampton\LaravelDatabaseLogger\Services\LogMonoLog::class
2727
],
2828
```
29+
30+
## Configuration
31+
A scheduled task is bundled with the package, which will delete rows in the ```logs``` table older than the expiration setting. To use this:
32+
* Run ```php artisan vendor:publish``` to publish the ```database_logger.php``` config file to your project
33+
* Run ```php artisan config:cache``` to ensure the project config is up to date
34+
* Set the expiration length (in days) in your project's ```config/database_logger.php``` file
35+
* Add an entry to the ```app/Console/Commands/Kernel.php``` file to schedule the cron job, something like: ```$schedule->command('logs:prune')->dailyAt('07:45');```
36+
37+
To run the command manually: ```php artisan logs:prune```
38+
2939
## Usage
3040
The package is pretty much a custom channel for Monolog, so you can use the existing facade and methods.
3141

0 commit comments

Comments
 (0)