Skip to content

[FrameworkBundle][HttpKernel] Allow configuring the logging channel per type of exceptions #57309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Arkalo2
Copy link
Contributor

@Arkalo2 Arkalo2 commented Jun 4, 2024

Q A
Branch? 7.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT

Status code can be customize depending on thrown Exception. It could be interesting to also customize the channel used.
Example:

# config/packages/framework.yaml
framework:
    exceptions:
        Symfony\Component\HttpKernel\Exception\BadRequestHttpException:
            log_level: debug
            status_code: 422
        Symfony\Component\Security\Core\Exception\AuthenticationException:
            log_channel: security
        Gotenberg\Exceptions\GotenbergApiErroed:
            log_channel: pdf

https://symfony.com/blog/new-in-symfony-5-4-configurable-exceptions#comment-24758

@carsonbot

This comment has been minimized.

@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch 2 times, most recently from d044ce8 to 90b01f2 Compare June 4, 2024 12:13
@carsonbot carsonbot changed the title Feat/add exception.x.log channel [FrameworkBundle][HttpKernel] Feat/add exception.x.log channel Jun 8, 2024
@derrabus derrabus changed the title [FrameworkBundle][HttpKernel] Feat/add exception.x.log channel [FrameworkBundle][HttpKernel] Add exception.x.log channel Jun 8, 2024
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, here are a few comments.

@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch from 90b01f2 to da2bfeb Compare June 25, 2024 12:56
@nicolas-grekas nicolas-grekas changed the title [FrameworkBundle][HttpKernel] Add exception.x.log channel [FrameworkBundle][HttpKernel] Allow configuring the logging channel per type of exceptions Jun 25, 2024
@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch 2 times, most recently from 4d18193 to cc68a33 Compare June 27, 2024 13:12
@fabpot fabpot modified the milestones: 7.2, 7.3 Nov 20, 2024
@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch from 2f90e0b to bf0534d Compare March 16, 2025 08:15
@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch from bafaf13 to e365651 Compare March 21, 2025 18:12
@Arkalo2 Arkalo2 force-pushed the feat/add-exception.x.log_channel branch 5 times, most recently from 81eaca5 to 86b8a01 Compare March 24, 2025 10:23
@nicolas-grekas nicolas-grekas force-pushed the feat/add-exception.x.log_channel branch from 86b8a01 to 742a863 Compare March 24, 2025 10:45
@nicolas-grekas
Copy link
Member

Thank you @Arkalo2.

@nicolas-grekas nicolas-grekas merged commit 4fb2615 into symfony:7.3 Mar 24, 2025
3 of 9 checks passed
@fabpot fabpot mentioned this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants