Skip to content

Commit ccfbf85

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-54940: Stabilization and preparation for demo
1 parent 5bd2fdb commit ccfbf85

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/internal/Magento/Framework/App/StaticResource.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Magento\Framework\App\Filesystem\DirectoryList;
99
use Magento\Framework\ObjectManager\ConfigLoaderInterface;
1010
use Magento\Framework\Filesystem;
11+
use Psr\Log\LoggerInterface;
1112

1213
/**
1314
* Entry point for retrieving static resources like JS, CSS, images by requested public path
@@ -43,6 +44,9 @@ class StaticResource implements \Magento\Framework\AppInterface
4344
/** @var Filesystem */
4445
private $filesystem;
4546

47+
/** @var LoggerInterface */
48+
private $logger;
49+
4650
/**
4751
* @param State $state
4852
* @param Response\FileInterface $response
@@ -105,6 +109,7 @@ public function launch()
105109
*/
106110
public function catchException(Bootstrap $bootstrap, \Exception $exception)
107111
{
112+
$this->getLogger()->critical($exception->getMessage() . "\n" . $exception->getTraceAsString());
108113
if ($bootstrap->isDeveloperMode()) {
109114
$this->response->setHttpResponseCode(404);
110115
$this->response->setHeader('Content-Type', 'text/plain');
@@ -161,4 +166,19 @@ private function getFilesystem()
161166
}
162167
return $this->filesystem;
163168
}
169+
170+
/**
171+
* Retrieves LoggerInterface instance
172+
*
173+
* @return LoggerInterface
174+
* @deprecated
175+
*/
176+
private function getLogger()
177+
{
178+
if (!$this->logger) {
179+
$this->logger = $this->objectManager->get(LoggerInterface::class);
180+
}
181+
182+
return $this->logger;
183+
}
164184
}

0 commit comments

Comments
 (0)