File tree 2 files changed +5
-7
lines changed
Bundle/TwigBundle/Resources/config
Component/HttpKernel/EventListener 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 128
128
<tag name =" monolog.logger" channel =" request" />
129
129
<argument >%twig.exception_listener.controller%</argument >
130
130
<argument type =" service" id =" logger" on-invalid =" null" />
131
- <argument >%twig.exception_listener.http_status_codes_log_level %</argument >
131
+ <argument >%framework.http_exception.log_levels %</argument >
132
132
</service >
133
133
134
134
<service id =" twig.controller.exception" class =" Symfony\Bundle\TwigBundle\Controller\ExceptionController" public =" true" >
Original file line number Diff line number Diff line change @@ -31,15 +31,13 @@ class ExceptionListener implements EventSubscriberInterface
31
31
{
32
32
protected $ controller ;
33
33
protected $ logger ;
34
- protected $ httpStatusCodeLogLevel = array () ;
34
+ protected $ httpStatusCodeLogLevel ;
35
35
36
- public function __construct ($ controller , LoggerInterface $ logger = null , $ httpStatusCodeLogLevel = array ())
36
+ public function __construct ($ controller , LoggerInterface $ logger = null , array $ httpStatusCodeLogLevel = array ())
37
37
{
38
38
$ this ->controller = $ controller ;
39
39
$ this ->logger = $ logger ;
40
- if ($ httpStatusCodeLogLevel && is_array ($ httpStatusCodeLogLevel )) {
41
- $ this ->httpStatusCodeLogLevel = $ httpStatusCodeLogLevel ;
42
- }
40
+ $ this ->httpStatusCodeLogLevel = $ httpStatusCodeLogLevel ;
43
41
}
44
42
45
43
public function logKernelException (GetResponseForExceptionEvent $ event )
@@ -87,7 +85,7 @@ public static function getSubscribedEvents()
87
85
);
88
86
}
89
87
90
- protected function getExceptionLogLevel (\Exception $ exception )
88
+ protected function getExceptionLogLevel (\Exception $ exception ): LogLevel
91
89
{
92
90
$ logLevel = LogLevel::CRITICAL ;
93
91
if ($ exception instanceof HttpExceptionInterface) {
You can’t perform that action at this time.
0 commit comments