Description
Description
When using Datadog and Docker, it is recommended to only ever print JSON (for Datadog) to the output (because the output of the main process is the output of the whole container). Datadog documents how to properly configure a Symfony application to fulfill that requirement: https://docs.datadoghq.com/logs/log_collection/php/?tab=phpmonolog
They don't mention it, but you should probably also use --quiet
when running a command in production, so that only the json logs show up in the output.
There's one thing that you can't however prevent, and that is the exception rendering done by
symfony/src/Symfony/Component/Console/Application.php
Lines 820 to 830 in c8b962a
Because of it, what you will see on Datadog is:
- a properly formatted, CRITICAL datadog line thanks to the monolog configuration
- one INFO line for each line in the unformatted output.
Example
It might be nice to have something like
framework:
render_errors: '%kernel.debug%'
to configure this.