Skip to content

Commit aa34f86

Browse files
committed
Update README.md
1 parent 1672e78 commit aa34f86

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
@@ -41,19 +41,36 @@ This packages provides a full abstraction for Understand.io and provides extra f
4141
'token' => 'my-input-token'
4242
```
4343

44+
6. Send your first event:
45+
46+
```php
47+
// anywhere inside your Laravel app
48+
\Log::info('Understand.io test');
49+
```
50+
4451
### How to send events/logs
4552

4653
#### Laravel logs
4754
By default, Laravel automatically stores its logs in ```app/storage/logs```. By using this package, your logs can also be sent to your Understand.io channel. This includes error and exception logs, as well as any log events that you have defined (for example, ```Log::info('my custom log')```).
4855

56+
```php
57+
\Log::info('my message', ['my_custom_field' => 'my data']);
58+
```
59+
60+
[Laravel logging documentation](http://laravel.com/docs/errors#logging)
61+
62+
#### PHP/Laravel exceptions
63+
By default, All exceptions will be send to Understand.io service.
4964

5065
#### Eloquent model logs
5166
Eloquent model logs are generated whenever one of the `created`, `updated`, `deleted` or `restored` Eloquent events is fired. This allows you to automatically track all changes to your models and will contain a current model diff (`$model->getDirty()`), the type of event (created, updated, etc) and additonal meta data (user_id, session_id, etc). This means that all model events will be transformed into a log event which will be sent to Understand.io.
5267

5368
By default model logs are disabled. To enable model logs, you can set the config value to `true`:
5469

5570
```php
56-
'eloquent_logs' => true,
71+
'log_types' => [
72+
'eloquent_log' => [
73+
'enabled' => true,
5774
```
5875

5976
### Additional meta data (field providers)
@@ -64,7 +81,7 @@ You may wish to capture additional meta data with each event. For example, it ca
6481
* Specify additional field providers for each log
6582
* E.g. sha1 version session_id will be appended to each "Log::info('event')"
6683
*/
67-
'log_types' => [
84+
'log_types' => [
6885
'eloquent_log' => [
6986
'enabled' => false,
7087
'meta' => [

0 commit comments

Comments
 (0)