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 16, 2020
1 parent 4ae887f commit f39f68e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ Laravel logs to database table via custom Monolog channel + Eloquent model.
]
]
```
* Add a setting to your .env file for the new channel name: ```LOG_CHANNEL=database```
* Update the log stack array in ```config\logging.php``` to include the new channel:

```
'stack' => [
'driver' => 'stack',
'channels' => ['daily', 'database'],
],
'database' => [
'driver' => 'custom',
'via' => \AdamCrampton\LaravelDatabaseLogger\Services\LogMonoLog::class
],
```
## Usage
The package is pretty much a custom channel for Monolog, so you can use the existing facade and methods.

Expand All @@ -28,4 +38,4 @@ These columns are automatically populated when adding to the log:

Additionally, you can pass in a ```category``` and ```sub_category``` value, which will be saved to those columns when generating a log entry. Example:

```Log::info('test', ['category' => 'This is a category', 'sub_category' => 'This is a subcategory]);```
```Log::info('test', ['category' => 'This is a category', 'sub_category' => 'This is a subcategory]);```

0 comments on commit f39f68e

Please sign in to comment.