Skip to content

Commit 2634e5f

Browse files
authored
Merge pull request #4 from oliverde8/fix-missing-logs
Fix logs missing in some cases.
2 parents 27c3b3d + 22aedfa commit 2634e5f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.0.4
2+
- :wrench: Fix logs not being saved in some conditions.
3+
-
14
# 1.0.3
25
- :wrench: Fix context & other objects being shared between executions when using Messenger.
36

@@ -32,4 +35,4 @@
3235
- :wrench: Various fixes and improvements.
3336

3437
# 1.0.0 Alpha #1
35-
- :confetti_ball: :tada: First release :tada: :confetti_ball:
38+
- :confetti_ball: :tada: First release :tada: :confetti_ball:

Model/ExecutionContext.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Oliverde8\PhpEtlBundle\Model;
44

5+
use Monolog\Logger;
56
use Oliverde8\Component\PhpEtl\Model\File\FileSystemInterface;
67
use Oliverde8\Component\PhpEtl\Model\File\LocalFileSystem;
78
use Psr\Log\LoggerInterface;
@@ -19,7 +20,11 @@ public function __construct(array $parameters, FileSystemInterface $fileSystem,
1920

2021
protected function finalise(): void
2122
{
22-
23+
if ($this->logger instanceof Logger) {
24+
foreach ($this->logger->getHandlers() as $handler) {
25+
$handler->close();
26+
}
27+
}
2328

2429
if ($this->fileSystem instanceof LocalFileSystem && $this->fileSystem->getRootPath() == $this->workDir) {
2530
// Local file system needs no moving of the log file.

0 commit comments

Comments
 (0)