Review main Abandoned

62307[TASK] Instantiate log manager after service container

Alexander Schnitzler CR 0 V 0 Normal +122 −45 updated 11/23/19, 14:05

Commit message

Very early in the bootstrap, the LogManager has been manually
created because it was needed during the instatiation of both
the error and exception handler because they do log errors via
the standard log api. This made it impossible to configure the
log manager and therefore the whole logging via DI.

This patch moves the initialization of the log manager, the error
and exception handler after the creation of the services container.
The late instantiation of the error and exception handler mean
that all errors and exceptions that happen during the bootstrap
until the creation of the handlers or not handled by the handlers
of course. To minimize the negative impact of that, display_errors
is still set early in the bootstrap.

It's worth noting that while there is no custom error handler
registered, the native error handler of PHP is handling errors
according to the error level set via error_reporting in php.ini.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1117

  1. Alexander Schnitzler uploaded patch set 1 11/12/19, 16:42

  2. TYPO3com voted on patch set 1 V -1 11/12/19, 16:45 Completed build in 02m 53s on Tue, 12 Nov, 04:45 PM Test Summary: 7613 of 48523 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38310

  3. Alexander Schnitzler uploaded patch set 2 11/12/19, 16:53

  4. TYPO3com voted on patch set 2 V -1 11/12/19, 17:01 Completed build in 07m 27s on Tue, 12 Nov, 05:01 PM Test Summary: 7613 of 48601 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38313

  5. Alexander Schnitzler uploaded patch set 3 11/12/19, 17:11

  6. Alexander Schnitzler uploaded patch set 4 11/12/19, 17:15

  7. TYPO3com voted on patch set 4 V -1 11/12/19, 17:15 Completed build in 11s on Tue, 12 Nov, 05:15 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38315

  8. TYPO3com voted on patch set 3 V -1 11/12/19, 17:18 Completed build in 06m 55s on Tue, 12 Nov, 05:18 PM Test Summary: 7062 of 48053 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38314

  9. Alexander Schnitzler uploaded patch set 5 11/12/19, 17:25

  10. TYPO3com voted on patch set 5 V +1 11/12/19, 17:33 Completed build in 08m 20s on Tue, 12 Nov, 05:33 PM Test Summary: 48296 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38316

  11. Alexander Schnitzler uploaded patch set 6 11/13/19, 09:16

  12. TYPO3com voted on patch set 6 V +1 11/13/19, 09:23 Completed build in 07m 14s on Wed, 13 Nov, 09:23 AM Test Summary: 48320 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-38333

  13. Alexander Schnitzler commented on patch set 6 11/13/19, 09:29

    Unresolved

    That's not correct. error_reporting is defined in the EnvironmentBuilder.
  14. Helmut Hummel commented on patch set 6 11/14/19, 17:57

    I totally get the need for DI for logging

    Unresolved

    With that, we would give up exceptions thrown during the DI container build being properly (nicely rendered) shown to developers. Also we would give up on warnings produced during this process to be converted to exceptions. To me both things wouldn't be desired. So a followup to this change should fix this.

    Bootstrap.php:145 Unresolved

    doesn't this mean, that GeneralUtility::makeInstance will provide a different LogManager object than when getting it injected with DI? Naively I'd do a $logManager = $container->get(LogManager::class) here instead.
  15. Helmut Hummel commented on patch set 6 CR -1 11/14/19, 17:58

    -1 for now until questions are resolved. in general change makes sense to me
  16. Alexander Schnitzler commented on patch set 6 CR -2 11/15/19, 08:54

    Unfortunately I found that while initializing the caches, the LogManager is also already needed and instantiated without the DI container.
  17. Alexander Schnitzler abandoned the change 11/23/19, 14:05