Contributed by Grégoire Pineau in #42244.
In Symfony applications, logging is available either via Symfony's built-in logger and or via the Monolog logger and its tight integration with Symfony. When using Monolog you can access to features such as excluding certain HTTP codes from logs and logging messages to different files. In Symfony 5.4 we've improved the logger with a new feature to make exceptions configurable per class. Using the new framework.exceptions option you can now define the log level and the HTTP status of the exceptions associated to a certain class:
1
2 3 4 5 6 7 8 9
config/packages/framework.yaml
framework: exceptions: Symfony\Component\HttpKernel\Exception\BadRequestHttpException: log_level: debug status_code: 422 App\Something\Exception\SomeException: log_level: alert status_code: 503
Although this example uses the YAML config format, this feature is also available when using XML or PHP as the config format.
Sponsor the Symfony project.
Autentifică-te pentru a adăuga comentarii
Alte posturi din acest grup

Symfony 7.3 includes many small improvements aimed at making developers' lives easier and more productive. This blog post highlights some of the most useful DX (Developer Experience) features added in

Symfony 7.3 introduces several enhancements to the Validator component, focusing on developer experience, better configurability, and more expressive constraint definitions.
Allow to Disable Translat

Symfony 7.3 adds a new JsonStreamer component as a high-performance, low-memory JSON encoding and decoding utility. However, the Serializer component still has many valid use cases, even for JSON cont

Symfony 7.3.0-RC1 has just been released. This is a pre-release version of Symfony 7.3. If you want to test it in your own applications before its final release, run the following commands:

This week, development activity focused on putting the final touches on Symfony 7.3 in preparation for its stable release next week. In addition, we published a security fix for a potential vulnerabil

Symfony's bridge packages integrate third-party services, such as mailers, notifiers, and translation providers, into Symfony applications. With more than 120 bridges available today, Symfony supports

Symfony Messenger component keeps evolving to meet the needs of complex, modern applications. In Symfony 7.3, we're introducing several powerful features to it.
Run Process Using the Shell… https://s