Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3630,6 +3630,23 @@ to the ``#[WithHttpStatus]`` attribute on the exception class::

The ``#[WithHttpStatus]`` attribute was introduced in Symfony 6.3.

It is also possible to map a log level on a custom exception class using
the ``#[WithLogLevel]`` attribute::

namespace App\Exception;

use Psr\Log\LogLevel;
use Symfony\Component\HttpKernel\Attribute\WithLogLevel;

#[WithLogLevel(LogLevel::WARNING)]
class CustomException extends \Exception
{
}

.. versionadded:: 6.3

The ``#[WithLogLevel]`` attribute was introduced in Symfony 6.3.

.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
.. _`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
.. _`PhpStormProtocol`: https://github.com/aik099/PhpStormProtocol
Expand Down