Skip to content

Commit 366aeb5

Browse files
committed
* Fix output format
1 parent b255ef9 commit 366aeb5

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Version 6.0.0
2+
* Add managing exceptions with a stream
3+
14
# Version 5.5.0
25
* Added cleanup commands
36
* Updated for PHP 8.2
@@ -6,7 +9,7 @@
69
* Fix File Exceptions integration
710

811
# Version 5.4.0
9-
* Add possibility to save exceptions in file
12+
* Add the possibility to save exceptions in the file
1013

1114
# Version 5.3.1
1215
* Fix interface naming

src/Processor/JobProcessor.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use CodeRhapsodie\DataflowBundle\Logger\DelegatingLogger;
1616
use CodeRhapsodie\DataflowBundle\Registry\DataflowTypeRegistryInterface;
1717
use CodeRhapsodie\DataflowBundle\Repository\JobRepository;
18-
use Monolog\Formatter\JsonFormatter;
18+
use Monolog\Formatter\LineFormatter;
1919
use Monolog\Handler\StreamHandler;
2020
use Monolog\Logger;
2121
use Psr\Log\LoggerAwareInterface;
@@ -24,6 +24,8 @@
2424

2525
class JobProcessor implements JobProcessorInterface, LoggerAwareInterface
2626
{
27+
private const FORMAT = "[%datetime%] %level_name% when processing item %context.index%: %message% %context% %extra%\n";
28+
2729
use LoggerAwareTrait;
2830

2931
public function __construct(
@@ -45,7 +47,7 @@ public function process(Job $job): void
4547
}
4648

4749
$handler = new StreamHandler(tempnam(sys_get_temp_dir(), 'dataflow_'));
48-
$handler->setFormatter(new JsonFormatter(appendNewline: false));
50+
$handler->setFormatter(new LineFormatter(self::FORMAT));
4951

5052
$loggers = [new Logger('dataflow_internal', [$bufferHandler = $handler])];
5153
if (isset($this->logger)) {

0 commit comments

Comments
 (0)