File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/batch-symfony-framework Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 19
19
"symfony/http-kernel" : " ^6.4|^7.0" ,
20
20
"symfony/framework-bundle" : " ^6.4|^7.0" ,
21
21
"yokai/batch" : " ^0.5.0" ,
22
- "psr/log" : " ^1.0 |^2.0 |^3.0 "
22
+ "psr/log" : " ^1.1 |^2|^3"
23
23
},
24
24
"autoload" : {
25
25
"psr-4" : {
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