File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -3630,6 +3630,23 @@ to the ``#[WithHttpStatus]`` attribute on the exception class::
3630
3630
3631
3631
The ``#[WithHttpStatus] `` attribute was introduced in Symfony 6.3.
3632
3632
3633
+ It is also possible to map a log level on a custom exception class using
3634
+ the ``#[WithLogLevel] `` attribute::
3635
+
3636
+ namespace App\Exception;
3637
+
3638
+ use Psr\Log\LogLevel;
3639
+ use Symfony\Component\HttpKernel\Attribute\WithLogLevel;
3640
+
3641
+ #[WithLogLevel(LogLevel::WARNING)]
3642
+ class CustomException extends \Exception
3643
+ {
3644
+ }
3645
+
3646
+ .. versionadded :: 6.3
3647
+
3648
+ The ``#[WithLogLevel] `` attribute was introduced in Symfony 6.3.
3649
+
3633
3650
.. _`HTTP Host header attacks` : https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
3634
3651
.. _`Security Advisory Blog post` : https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning
3635
3652
.. _`PhpStormProtocol` : https://github.com/aik099/PhpStormProtocol
You can’t perform that action at this time.
0 commit comments