File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Magento \Framework \App \Filesystem \DirectoryList ;
9
9
use Magento \Framework \ObjectManager \ConfigLoaderInterface ;
10
10
use Magento \Framework \Filesystem ;
11
+ use Psr \Log \LoggerInterface ;
11
12
12
13
/**
13
14
* Entry point for retrieving static resources like JS, CSS, images by requested public path
@@ -43,6 +44,9 @@ class StaticResource implements \Magento\Framework\AppInterface
43
44
/** @var Filesystem */
44
45
private $ filesystem ;
45
46
47
+ /** @var LoggerInterface */
48
+ private $ logger ;
49
+
46
50
/**
47
51
* @param State $state
48
52
* @param Response\FileInterface $response
@@ -105,6 +109,7 @@ public function launch()
105
109
*/
106
110
public function catchException (Bootstrap $ bootstrap , \Exception $ exception )
107
111
{
112
+ $ this ->getLogger ()->critical ($ exception ->getMessage () . "\n" . $ exception ->getTraceAsString ());
108
113
if ($ bootstrap ->isDeveloperMode ()) {
109
114
$ this ->response ->setHttpResponseCode (404 );
110
115
$ this ->response ->setHeader ('Content-Type ' , 'text/plain ' );
@@ -161,4 +166,19 @@ private function getFilesystem()
161
166
}
162
167
return $ this ->filesystem ;
163
168
}
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
+ }
164
184
}
You can’t perform that action at this time.
0 commit comments