`How to properly handle exceptions in Symfony?
G
G
grabbee2019-06-30 16:34:16
symfony
grabbee, 2019-06-30 16:34:16

How to properly handle exceptions in Symfony?

When using ` $this->denyAccessUnlessGranted() ` an Access Denied Exception is thrown and goes straight to prod.log resulting in a bunch of 401 403 and 400 request.ERROR: Uncaught PHP Exception
Is this normal? The log swells with meaningless information.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Samsonov, 2019-06-30
@grabbee

You can exclude logging of certain HTTP codes
https://symfony.com/doc/current/logging/monolog_ex...
Or more flexible by creating your own activation_strategy
https://github.com/symfony/monolog-bundle/issues/8.. .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question