Skip to content

Commit 276631e

Browse files
authored
Merge pull request #48 from ERuban/use-php-for-symfony-example
Use PHP for Symfony monolog example
2 parents 579baa3 + 24acfa3 commit 276631e

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

docs/config/monolog.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,23 @@ LOG_SOCKET_URL=127.0.0.1:9913
7979

8080
Here is an example of how to configure Monolog to send logs to Buggregator in Symfony.
8181

82-
```yaml
83-
# config/packages/dev/monolog.yaml
84-
monolog:
85-
handlers:
86-
socket:
87-
level: debug
88-
type: socket
89-
formatter: monolog.formatter.json
90-
connection_string: '%env(MONOLOG_SOCKET_HOST)%'
82+
```php
83+
# config/packages/dev/monolog.php
84+
<?php
85+
86+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
87+
88+
use Symfony\Config\MonologConfig;
89+
90+
return static function (MonologConfig $monologConfig): void {
91+
$monologConfig
92+
...
93+
->handler('socket')
94+
->level('debug')
95+
->formatter('monolog.formatter.json')
96+
->type('socket')
97+
->connectionString(env('MONOLOG_SOCKET_HOST'));
98+
};
9199
```
92100

93101
### Configuration

0 commit comments

Comments
 (0)