You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can skip all function variables and the default settings from the config/logtodb.php will be used.
@@ -211,7 +214,19 @@ No migrations needed for MongoDB.
211
214
212
215
No indexes are added per default, so if you fetch a lot of log results based on specific time ranges or types: it might be a good idea to add some indexes.
213
216
214
-
#### Log Cleanup
217
+
## Log Cleanup
218
+
There are config values that you can set to specify the max number of log records to keep, or the max record age in hours.
<b>These option is set to *false* per default, these have to be set to desired integers before you can run the "log:delete" artisan command.</b>
224
+
```
225
+
php artisan log:delete
226
+
```
227
+
This command will delete records based on settings described above. Add this command to your Console/kernel.php, or run manually in cron etc to enable automatic cleanup.
228
+
229
+
#### Manual Cleanup
215
230
There is a helper function to remove the oldest log events and keep a specified number
Monolog ships with a set of [processors](https://github.com/Seldaek/monolog/tree/master/src/Monolog/Processor), these will generate additional data and populate the 'extra' field.
229
244
230
245
You could also create your own custom processor, make sure they implement [Monolog\Processor\ProcessorInterface](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Processor/ProcessorInterface.php).
@@ -250,7 +265,7 @@ class PhpVersionProcessor implements ProcessorInterface {
250
265
251
266
```
252
267
253
-
#### Advanced /config/logging.php example
268
+
##More logging.php config examples
254
269
```php
255
270
'default' => env('LOG_CHANNEL', 'stack'),
256
271
@@ -269,7 +284,9 @@ class PhpVersionProcessor implements ProcessorInterface {
0 commit comments