You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 11, 2022. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+14-9
Original file line number
Diff line number
Diff line change
@@ -12,21 +12,26 @@
12
12
## Logging exceptions
13
13
The default settings enable logging of exceptions. It will add the HTTP request to the GELF message, but it will not add POST values. Check the graylog2.log-requests config to enable or disable this behavior.
14
14
15
+
## Message Processors
16
+
Processors add extra functionality to the handler. You can register processors adding this to your AppServiceProvider:
In the default package, the following processors are available:
21
+
### ExceptionProcessor
22
+
Adds exception data to the message if there is any.
23
+
### RequestProcessor
24
+
Adds the current Laravel Request to the message. It adds the url, method and ip by default.
25
+
15
26
### Don't report exceptions
16
27
In `app/Exceptions/Handler.php` you can define the $dontReport array with Exception classes that won't be reported to the logger. For example, you can blacklist the \Illuminate\Database\Eloquent\ModelNotFoundException. Check the [Laravel Documentation](https://laravel.com/docs/5.4/errors#the-exception-handler) about errors for more information.
17
28
18
-
### Send default additional data
19
-
Using the config, you can specify additional key => value data to be sent with the GELF message. For example, you can use this to add a client ID to a message.
20
-
21
29
## Logging arbitrary data
22
30
You can instantiate the Graylog2 class to send additional GELF messages:
23
31
24
-
```
25
-
$graylog2 = app('graylog2');
26
-
27
-
32
+
```php
28
33
// Send default log message
29
-
$graylog2->log('emergency', 'Dear Sir/Madam, Fire! Fire! Help me!. 123 Cavendon Road. Looking forward to hearing from you. Yours truly, Maurice Moss.', ['facility' => 'ICT']);
34
+
Graylog2::log('emergency', 'Dear Sir/Madam, Fire! Fire! Help me!. 123 Cavendon Road. Looking forward to hearing from you. Yours truly, Maurice Moss.', ['facility' => 'ICT']);
30
35
31
36
32
37
// Send custom GELF Message
@@ -36,7 +41,7 @@ $message->setShortMessage('Fire! Fire! Help me!');
36
41
$message->setFullMessage('Dear Sir/Madam, Fire! Fire! Help me!. 123 Cavendon Road. Looking forward to hearing from you. Yours truly, Maurice Moss.');
0 commit comments