Skip to content

Commit 4272eeb

Browse files
authored
Merge pull request #1978 from brefphp/fix-symfony-logs-formatter-config
Fix the documentation for Symfony when using `CloudWatchFormatter`
2 parents b58007a + 83b4491 commit 4272eeb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/environment/logs.mdx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,25 @@ All logs written to `stdout` or `stderr` are automatically be sent to CloudWatch
5454
<Tab>
5555
If you use Symfony, Bref will automatically configure Symfony to log to CloudWatch via `stderr`. You don't have to do anything.
5656

57-
It is recommended you enable Bref's logs formatter optimized for CloudWatch:
57+
It is recommended you enable Bref's logs formatter optimized for CloudWatch, for example:
5858

5959
```yaml filename="config/packages/prod/monolog.yaml"
6060
monolog:
6161
handlers:
62-
file:
62+
main:
6363
type: stream
6464
level: info
65+
path: php://stderr
6566
formatter: 'Bref\Monolog\CloudWatchFormatter'
6667
```
6768

69+
If you do use that formatter, you also need to declare the service in your `services.yaml` (a pull request in [the Symfony bridge](https://github.com/brefphp/symfony-bridge) to do this automatically is welcome!):
70+
71+
```yaml filename="config/services.yaml"
72+
services:
73+
Bref\Monolog\CloudWatchFormatter: ~
74+
```
75+
6876
<Callout>
6977
This formatter will be enabled by default in Bref v3.
7078
</Callout>

0 commit comments

Comments
 (0)