From c312bea9a9369adcd638407f3a044c16816cf32d Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Sat, 26 Sep 2026 22:56:29 +0200 Subject: [PATCH] Documentation: the Symfony bundle that enables the log formatter Claude-Session: https://claude.ai/code/session_0168N55uBK9UjfpL6r8oGjDm --- docs/environment/logs.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/environment/logs.mdx b/docs/environment/logs.mdx index 550339e8c..02107204c 100644 --- a/docs/environment/logs.mdx +++ b/docs/environment/logs.mdx @@ -43,6 +43,15 @@ AWS Lambda has a built-in mechanism to forward logs written to `stderr` (or `std If you use Symfony, Bref will automatically configure Symfony to log to CloudWatch via `stderr` with the `Bref\Monolog\CloudWatchFormatter` formatter. You don't have to do anything. + This is done by the `Bref\SymfonyBridge\BrefSymfonyBridgeBundle` bundle, which Symfony Flex adds to `config/bundles.php` when installing `bref/symfony-bridge`. If it is missing from that file, add it: + + ```php filename="config/bundles.php" + return [ + // ... + Bref\SymfonyBridge\BrefSymfonyBridgeBundle::class => ['all' => true], + ]; + ``` + If you have a custom log setup, you should ensure that logs are sent to `stderr` (e.g. using the `stream` handler with `php://stderr`) with the `Bref\Monolog\CloudWatchFormatter` formatter (`bref.cloudwatch_formatter` service). With this formatter, logs will contain structured data that can be filtered in CloudWatch Logs Insights. For example, you can filter by log level or exception class.