Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcrampton authored Feb 18, 2020
1 parent 3ef6dff commit cfb1fad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ Laravel logs to database table via custom Monolog channel + Eloquent model.
'via' => \AdamCrampton\LaravelDatabaseLogger\Services\LogMonoLog::class
],
```

## Configuration
A scheduled task is bundled with the package, which will delete rows in the ```logs``` table older than the expiration setting. To use this:
* Run ```php artisan vendor:publish``` to publish the ```database_logger.php``` config file to your project
* Run ```php artisan config:cache``` to ensure the project config is up to date
* Set the expiration length (in days) in your project's ```config/database_logger.php``` file
* 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');```

To run the command manually: ```php artisan logs:prune```

## Usage
The package is pretty much a custom channel for Monolog, so you can use the existing facade and methods.

Expand Down

0 comments on commit cfb1fad

Please sign in to comment.