File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/batch-symfony-framework/docs Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,30 @@ The job launcher that will be injected depends on the packages you have installe
106
106
107
107
108
108
# # Use the batchLogger
109
+ The aim of the batchLogger is to store log inside the jobExecution.
109
110
In a symfony project, you can use the batchLogger with the symfony autowiring by naming your variable as `$yokaiBatchLogger`
110
111
111
112
` ` ` php
113
+ <?php
114
+
115
+ namespace App;
116
+
112
117
use Psr\L og\L oggerInterface;
113
118
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
+ }
116
130
}
117
131
` ` `
132
+ ```
118
133
119
134
## On the same subject
120
135
You can’t perform that action at this time.
0 commit comments