#100309Show stacktrace in logs for core ProductionExceptionHandler
Description
There are different kinds of log messages created by different TYPO3 components.
The Frontend component=“TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler” writes a complete stack trace to the log.
The TYPO3.CMS.Core.Error.ProductionExceptionHandler (e.g. called in BE) does not.
This makes it difficult to troubleshoot these kinds of errors.
Example with TYPO3.CMS.Core.Error.ProductionExceptionHandler
(added line breaks for better reaability):
Sun, 26 Mar 2023 09:53:13 +0200 [CRITICAL] request="230e8bb9a282c"
component="TYPO3.CMS.Core.Error.ProductionExceptionHandler":
Core: Exception handler (WEB: BE): InvalidArgumentException, code #1436717322,
file /var/www/mysite/releases/118/public/typo3/sysext/core/Classes/Http/Uri.php, line 125:
The parsedUri "http:///something/or/other" appears to be malformed -
{"mode":"WEB","application_mode":"BE","exception_class":"InvalidArgumentException","exception_code":1436717322,
"file":"/var/www/mysite/releases/118/public/typo3/sysext/core/Classes/Http/Uri.php","line":125,
"message":
"The parsedUri \"http:///something/or/other" appears to be malformed",
"request_url":"http:///something/or/other","exception":null}
Example with “TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler”
Sun, 26 Mar 2023 11:49:22 +0200 [ALERT] request="bc9e08161a068"
component="TYPO3.CMS.Frontend.ContentObject.Exception.ProductionExceptionHandler":
Oops, an error occurred! Code: 202303260949217e3aa0de- RequiredArgumentMissingException:
Required argument "mail" is not set for In2code\Powermail\Controller\FormController->create.,
in file /var/www/mysite/releases/118/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php:1048
- {"exception":"TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Exception\\RequiredArgumentMissingException: Required argument \"mail\" is not set for In2code\\Powermail\\Controller\\FormController->create.
in /var/www/mysite/releases/118/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php:1048
Stack trace:
#0 /var/www/mysite/releases/118/public/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php(485): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->mapRequestArgumentsToControllerArguments()
#1 /var/www/mysite/releases/118/public/typo3/sysext/extbase/Classes/Mvc/Dispatcher.php(96): TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController->processRequest(Object(TYPO3\\CMS\\Extbase\\Mvc\\Request))
#2 /var/www/mysite/releases/118/public/typo3/sysext/extbase/Classes/Mvc/Web/FrontendRequestHandler.php(46): TYPO3\\CMS\\Extbase\\Mvc\\Dispatcher->dispatch(Object(TYPO3\\CMS\\Extbase\\Mvc\\Request))
#3
....
How to cause an error with log messages (for testing)
in BE:
- (very invasive, only on test system!!!!) change parmission of var/cache folder to make it inaccessible for web user
in CLI:
…..