Skip to content

Commit 3cef197

Browse files
MAGETWO-32161: Logging is broken
1 parent 2ba9d35 commit 3cef197

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,14 @@ public function initialize($overriddenParams = [])
279279
[
280280
'name' => 'integration-tests',
281281
'handlers' => [
282-
'system' => $objectManager->get('Magento\Framework\Logger\Handler\System'),
283-
'debug' => $objectManager->get('Magento\Framework\Logger\Handler\Debug'),
282+
'system' => $objectManager->create(
283+
'Magento\Framework\Logger\Handler\System',
284+
['filePath' => $this->installDir]
285+
),
286+
'debug' => $objectManager->create(
287+
'Magento\Framework\Logger\Handler\Debug',
288+
['filePath' => $this->installDir]
289+
),
284290
]
285291
]
286292
);

lib/internal/Magento/Framework/Logger/Handler/Base.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ class Base extends StreamHandler
2929

3030
/**
3131
* @param DriverInterface $filesystem
32+
* @param string $filePath
3233
*/
33-
public function __construct(DriverInterface $filesystem)
34-
{
34+
public function __construct(
35+
DriverInterface $filesystem,
36+
$filePath = null
37+
) {
3538
$this->filesystem = $filesystem;
36-
parent::__construct(BP . $this->fileName, $this->loggerType);
39+
parent::__construct(
40+
$filePath ? $filePath . $this->fileName : BP . $this->fileName,
41+
$this->loggerType
42+
);
3743
}
3844

3945
/**

lib/internal/Magento/Framework/Logger/Handler/System.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ class System extends Base
2929
/**
3030
* @param DriverInterface $filesystem
3131
* @param Exception $exceptionHandler
32+
* @param string $filePath
3233
*/
3334
public function __construct(
3435
DriverInterface $filesystem,
35-
Exception $exceptionHandler
36+
Exception $exceptionHandler,
37+
$filePath = null
3638
) {
3739
$this->exceptionHandler = $exceptionHandler;
38-
parent::__construct($filesystem);
40+
parent::__construct($filesystem, $filePath);
3941
}
4042

4143
/**

0 commit comments

Comments
 (0)