Issue Feature Rejected

#100309Show stacktrace in logs for core ProductionExceptionHandler

Sybille Peters 03/27/23, 09:04 updated 04/24/25, 13:33

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:

…..

Reviews 1

History 913

  1. Sybille Peters commented and changed tracker Feature Bug TYPO3 Version 11 <span data-processor="relativetime" data-value="2023-03-27T09:11:16+00:00" > 03/27/23, 09:11 </span>

     protected bool $logExceptionStackTrace = false;

    exists in AbstractExceptionHandler

    This is set to true in the DebugExceptionHandler. It would be helpful if it were possible to configure this for production and for logging only. Possibly it should be different, based on context, e.g.

    - cli
    - BE
    - FE

  2. Sybille Peters changed subject core ProductionExceptionHandler does not show stacktrace in logs Show stacktrace in logs for core ProductionExceptionHandler <span data-processor="relativetime" data-value="2024-12-01T12:11:03+00:00" > 12/01/24, 12:11 </span>

  3. Sybille Peters changed attached file_storage_widdelgrumpf.png description <span data-processor="relativetime" data-value="2025-03-29T07:20:50+00:00" > 03/29/25, 07:20 </span>

  4. Christian Kuhn commented and changed status Under Review Rejected <span data-processor="relativetime" data-value="2025-04-24T13:33:10+00:00" > 04/24/25, 13:33 </span>

    rejected due to security considerations. see the comments added to the patch in the review system.