Skip to content

Commit c676a7c

Browse files
committed
Add some UserDataProcessor docs to the readme
1 parent 294912f commit c676a7c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,33 @@ Log::error('Oops, Something went wrong', [
102102
]);
103103
```
104104

105+
User data can alternatively be added to the context of any messages sent via a processor, such as the included `UserDataProcessor`; see below.
106+
107+
#### Included optional processors
108+
109+
##### `UserDataProcessor`
110+
111+
This processor attaches data about the current user to the error report.
112+
113+
```php
114+
'processors' => [
115+
Clowdy\Raven\Processors\UserDataProcessor::class,
116+
],
117+
```
118+
119+
Or, to configure the `UserDataProcessor` object:
120+
121+
```php
122+
'processors' => [
123+
new Clowdy\Raven\Processors\UserDataProcessor([
124+
'only' => ['id', 'username', 'email'], // This is ['id'] by default; pass [] or null to include all fields
125+
'appends' => ['normallyHiddenProperty'],
126+
]),
127+
],
128+
```
129+
130+
See the `UserDataProcessor` source for full details.
131+
105132
## Credits
106133

107134
This package was inspired [rcrowe/Raven](https://github.com/rcrowe/Raven).

0 commit comments

Comments
 (0)