File tree 2 files changed +15
-1
lines changed
src/Symfony/Bridge/Monolog
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=========
3
3
4
+ 4.1.0
5
+ -----
6
+
7
+ * ` WebProcessor ` now implements ` EventSubscriberInterface ` in order to be easily autoconfigured
8
+
4
9
4.0.0
5
10
-----
6
11
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bridge \Monolog \Processor ;
13
13
14
14
use Monolog \Processor \WebProcessor as BaseWebProcessor ;
15
+ use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
15
16
use Symfony \Component \HttpKernel \Event \GetResponseEvent ;
17
+ use Symfony \Component \HttpKernel \KernelEvents ;
16
18
17
19
/**
18
20
* WebProcessor override to read from the HttpFoundation's Request.
19
21
*
20
22
* @author Jordi Boggiano <j.boggiano@seld.be>
21
23
*/
22
- class WebProcessor extends BaseWebProcessor
24
+ class WebProcessor extends BaseWebProcessor implements EventSubscriberInterface
23
25
{
24
26
public function __construct (array $ extraFields = null )
25
27
{
@@ -34,4 +36,11 @@ public function onKernelRequest(GetResponseEvent $event)
34
36
$ this ->serverData ['REMOTE_ADDR ' ] = $ event ->getRequest ()->getClientIp ();
35
37
}
36
38
}
39
+
40
+ public static function getSubscribedEvents ()
41
+ {
42
+ return array (
43
+ KernelEvents::REQUEST => array ('onKernelRequest ' , 4096 ),
44
+ );
45
+ }
37
46
}
You can’t perform that action at this time.
0 commit comments