Skip to content

Commit a8f122e

Browse files
committed
#90 code review - update documentation & psr/log required version
1 parent bb3d308 commit a8f122e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/batch-symfony-framework/docs/getting-started.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,30 @@ The job launcher that will be injected depends on the packages you have installe
106106

107107

108108
## Use the batchLogger
109+
The aim of the batchLogger is to store log inside the jobExecution.
109110
In a symfony project, you can use the batchLogger with the symfony autowiring by naming your variable as `$yokaiBatchLogger`
110111

111112
```php
113+
<?php
114+
115+
namespace App;
116+
112117
use Psr\Log\LoggerInterface;
113118
114-
...
115-
__construct(private readonly LoggerInterface $yokaiBatchLogger) {
119+
final readonly class YourService
120+
{
121+
public function __construct(
122+
private LoggerInterface $yokaiBatchLogger,
123+
) {
124+
}
125+
126+
public function method()
127+
{
128+
$this->yokaiBatchLogger->error(...);
129+
}
116130
}
117131
```
132+
```
118133

119134
## On the same subject
120135

0 commit comments

Comments
 (0)