[TASK] Log message when typolink fails 06/57006/3
authorMathias Brodala <mbrodala@pagemachine.de>
Thu, 17 May 2018 13:39:44 +0000 (15:39 +0200)
committerMathias Brodala <mbrodala@pagemachine.de>
Fri, 18 May 2018 13:42:47 +0000 (15:42 +0200)
We log this as debug to not fill system logs by default.

Resolves: #85034
Releases: master, 8.7
Change-Id: Ica686e42fa7a2ef09f2f5c4bf9b91781f5c14dc9
Reviewed-on: https://review.typo3.org/57006
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index b1458d5..3060c82 100644 (file)
@@ -5702,6 +5702,10 @@ class ContentObjectRenderer
             try {
                 list($this->lastTypoLinkUrl, $linkText, $target) = $linkBuilder->build($linkDetails, $linkText, $target, $conf);
             } catch (UnableToLinkException $e) {
+                /** @var \TYPO3\CMS\Core\Log\Logger $logger */
+                $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
+                $logger->debug(sprintf('Unable to link "%s": %s', $e->getLinkText(), $e->getMessage()), ['exception' => $e]);
+
                 // Only return the link text directly
                 return $e->getLinkText();
             }