Skip to content

Commit c2734e2

Browse files
authored
Add skipping database logging with contextual information (#254)
1 parent 3bd6aab commit c2734e2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

services/error-log.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ An array of contextual data may also be passed to the log methods. This contextu
180180
Log::info('User failed to login.', ['id' => $user->id]);
181181
```
182182

183+
#### Skipping database logging
184+
185+
You can set `'skipDatabaseLog' => true` in the context data array to disable database logging.
186+
187+
```php
188+
Log::info('New user acces.', ['id' => $user->id, 'skipDatabaseLog' => true]);
189+
```
190+
191+
> **NOTE**: It is not recommended to skip database logging for important or critical information, as they would then no longer be accessible to administrators authenticated in the backend, but only by reading log files.
192+
183193
### Helper functions
184194

185195
There are some global helper methods available to make logging easier. The `trace_log` function is an alias for `Log::info` with support for using arrays and exceptions as the message.

0 commit comments

Comments
 (0)