File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1025,7 +1025,7 @@ exceptions
10251025
10261026**type **: ``array ``
10271027
1028- Defines the :ref: `log level </logging >` and HTTP status code applied to the
1028+ Defines the :ref: `log level </logging >`, :ref: ` log channel < /logging/channels_handlers >` and HTTP status code applied to the
10291029exceptions that match the given exception class:
10301030
10311031.. configuration-block ::
@@ -1038,6 +1038,7 @@ exceptions that match the given exception class:
10381038 Symfony\Component\HttpKernel\Exception\BadRequestHttpException :
10391039 log_level : ' debug'
10401040 status_code : 422
1041+ log_channel : ' custom_channel'
10411042
10421043 .. code-block :: xml
10431044
@@ -1055,6 +1056,7 @@ exceptions that match the given exception class:
10551056 class =" Symfony\Component\HttpKernel\Exception\BadRequestHttpException"
10561057 log-level =" debug"
10571058 status-code =" 422"
1059+ log-channel =" custom_channel"
10581060 />
10591061 <!-- ... -->
10601062 </framework : config >
@@ -1070,9 +1072,14 @@ exceptions that match the given exception class:
10701072 $framework->exception(BadRequestHttpException::class)
10711073 ->logLevel('debug')
10721074 ->statusCode(422)
1075+ ->logChannel('custom_channel')
10731076 ;
10741077 };
10751078
1079+ .. versionadded :: 7.3
1080+
1081+ The ``log_channel `` option was introduced in Symfony 7.3.
1082+
10761083The order in which you configure exceptions is important because Symfony will
10771084use the configuration of the first exception that matches ``instanceof ``:
10781085
You can’t perform that action at this time.
0 commit comments