[BUGFIX] Always log exception data if file handling fails 74/50474/2
authorMarkus Klein <markus.klein@typo3.org>
Mon, 31 Oct 2016 15:15:33 +0000 (16:15 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 1 Nov 2016 11:57:19 +0000 (12:57 +0100)
If file handling fails in ContentObjectRenderer the log message
must contain also the exception information, otherwise the
whole error message is useless.

Resolves: #78517
Releases: master, 7.6
Change-Id: I503f5bf17bba302326b9e9eb25faa58c00e35a36
Reviewed-on: https://review.typo3.org/50474
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 6e71d8e..293d087 100644 (file)
@@ -5775,7 +5775,7 @@ class ContentObjectRenderer
                 } catch (Exception $exception) {
                     /** @var \TYPO3\CMS\Core\Log\Logger $logger */
                     $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
-                    $logger->warning('The image "' . $file . '" could not be found and won\'t be included in frontend output');
+                    $logger->warning('The image "' . $file . '" could not be found and won\'t be included in frontend output', ['exception' => $exception]);
                     return null;
                 }
             }
@@ -6098,7 +6098,7 @@ class ContentObjectRenderer
         } catch (Exception $exception) {
             /** @var \TYPO3\CMS\Core\Log\Logger $logger */
             $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
-            $logger->warning('The file "' . $fileUidOrCurrentKeyword . '" could not be found and won\'t be included in frontend output');
+            $logger->warning('The file "' . $fileUidOrCurrentKeyword . '" could not be found and won\'t be included in frontend output', ['exception' => $exception]);
             $fileObject = null;
         }