Skip to content

Commit af2a4d0

Browse files
author
Daniel Mellum
committed
Update readme.
1 parent 53bdca8 commit af2a4d0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

readme.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,36 @@ composer require jenssegers/mongodb
5050
## Configuration
5151
Starting with Laravel 5.6 and later, you will have a new config file: "config/logging.php".
5252
You will need to add an array under 'channels' for Log-to-DB here like so:
53+
```php
54+
'database' => [
55+
'driver' => 'custom',
56+
'via' => danielme85\LaravelLogToDB\LogToDbHandler::class
57+
...
58+
],
59+
```
60+
These are the minimum required logging.php config settings to get started. Please note that the array index 'database'
61+
can be whatever string you like as long as it is unique to this logging config.
62+
You can also give the logging channel a name that later is referenced in a column in the DB table, this way you can have multiple
63+
logging-to-db channels.
64+
5365
```php
5466
'channels' => [
5567
'stack' => [
5668
'name' => 'Log Stack',
5769
'driver' => 'stack',
58-
'channels' => ['database', 'file'],
70+
'channels' => ['database', 'other-database', 'file'],
5971
],
6072
'database' => [
73+
'driver' => 'custom',
74+
'via' => danielme85\LaravelLogToDB\LogToDbHandler::class,
75+
'name' => 'Basic DB Logging'
76+
],
77+
'other-database' => [
6178
'driver' => 'custom',
6279
'via' => danielme85\LaravelLogToDB\LogToDbHandler::class,
6380
//'model' => App\Model\Log::class, //Your own optional custom model
6481
'level' => env('APP_LOG_LEVEL', 'debug'),
65-
'name' => 'My DB Log',
82+
'name' => 'My DB Log with a bunch more settings',
6683
'connection' => 'default',
6784
'collection' => 'log',
6885
'detailed' => true,

0 commit comments

Comments
 (0)