Review main Ready for review Stale

86827[TASK] Enrich log messages with the WebProcessor by default

Amir Arends CR 0 V -1 Easy +13 −2 updated 06/18/26, 23:04

Commit message

The WebProcessor, adding request related information
to the log messages, is now active by default.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 8
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/27/86827/8 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/27/86827/8 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V -1 Blocked
    • core-ci -1 CI

Merge conflicts 15

Issues 1

Files 3

Review log 2432

Show 67 earlier messages
  1. Amir Arends uploaded patch set 1 10/29/24, 14:47

  2. Sebastian Michaelsen voted on patch set 1 CR +1 V +1 10/29/24, 14:50

  3. core-ci voted on patch set 1 V -1 10/29/24, 14:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68790

  4. Amir Arends uploaded patch set 2 10/29/24, 14:52

    Copied Votes: * Code-Review+1 (copy condition: "**changekind:NO_CHANGE** OR is:MIN") * Verified+1, Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  5. Mathias Brodala commented on patch set 1 CR -1 V -1 10/29/24, 14:53

    Copied votes on follow-up patch sets have been updated: * Code-Review-1 has been copied to patch set 2 (copy condition: "changekind:NO_CHANGE OR is:MIN"). * Verified-1 has been copied to patch set 2 (copy condition: "changekind:NO_CHANGE").
  6. Sebastian Michaelsen commented on patch set 2 CR +1 V +1 10/29/24, 14:55

    Reply

    But does it make sense that for Exceptions the core adds the request URL by default, and for Errors you have to configure it yourself?
  7. Amir Arends uploaded patch set 3 CR +1 V +1 10/29/24, 14:57

  1. core-ci voted on patch set 2 V -1 10/29/24, 14:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68791

  2. core-ci voted on patch set 3 V +1 10/29/24, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68792

  3. Sebastian Michaelsen commented on patch set 3 10/29/24, 15:16

    Reply Unresolved

    In an "off the shelf" TYPO3 installation, you will have Exceptions logged in the Log module with URL and Errors without. Only in an "advanced" setup, where you manually configure logging you will have the URL included. And then have a way to access it, because entries written via the DatabaseWriter don't show up in the Log module, so essentially you need file system or database access or set up a more sophisticated log management like Splunk to access that information. In terms of "beginner friendliness" this patch adds value to TYPO3.
  4. Sebastian Michaelsen updated the commit message in patch set 4 V +1 10/29/24, 15:26

  5. core-ci voted on patch set 4 V +1 10/29/24, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68795

  6. Benni Mack commented on patch set 4 03/28/25, 10:29

    let's use WebProcessor by default in FactoryConfiguration, can somebody update the patch?
  7. Oli Bartsch uploaded patch set 5 V +1 06/23/25, 09:07

  8. core-ci voted on patch set 5 V -1 06/23/25, 09:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80582

  9. Oli Bartsch uploaded patch set 6 V -1 06/23/25, 09:29

  10. core-ci voted on patch set 6 V -1 06/23/25, 09:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80584

  11. Mathias Brodala commented on patch set 6 CR -1 06/23/25, 09:55

    DefaultConfiguration.php:1647

    I get the intention but let's make this "processorConfiguration" instead. This allows for easily discovering this with search basics like Github code search and grep. Also it's consistent with the "writerConfiguration" below.
  12. Oli Bartsch uploaded patch set 7 CR -1 V -1 06/23/25, 10:17

  13. Oli Bartsch commented on patch set 7 06/23/25, 10:27

    DefaultConfiguration.php:1647 Reply

    Done
  14. core-ci voted on patch set 7 V +1 06/23/25, 10:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80589

  15. Christian Kuhn commented on patch set 7 06/23/25, 19:40

    DefaultConfiguration.php:1649

    i'm not a huge fan of the WebProcessor since it uses GeneralUtility::getIndpEnv('_ARRAY') (we rather want to get rid of GeneralUtility::getIndpEnv() entirely since it is based on state from $GLOBALS). Also, I'm not 100% sure about WebProcessor from a security point of view and it may be better to not have it added by default, unsure.
  16. Markus Klein commented on patch set 7 07/29/25, 10:54

    DefaultConfiguration.php:1649 Reply Unresolved

    We enable it on literally every instance. It is otherwise almost impossible to track down errors properly. Also to see if a bot/search engine caused a faulty request or not. (which is often the case with Bing) I see no issue security-wise. GDPR-wise the IP is included, as in the webserver's access logs. So be sure to remove the logs regularly in accordance to your GDPR-rules. my2cents
  17. Benjamin Franzke commented on patch set 7 CR -1 07/30/25, 11:36

    DefaultConfiguration.php:1648

    Please be aware that the defined log level (`DEBUG`) for processor configurations does not act as a filter to only apply the processor if `DEBUG` level is configured in writer configurations, but applies to to all log messages *UP TO* that Level: https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Log/Logger.php#L166-L168 In case of `LogLevel::DEBUG` (highest) that means: All log messages with any level EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO or DEBUG are processed, *regardless* of the configured *desired* log level in `writerConfiguration`. As an intergrator I would expect for this processor to only be activated if I as an intergrator asked for `DEBUG` logs. Our current way to achieve that is to configure a log level in `wriiterConfiguration`. I understand that this "usecase" can't be handled here, but that's basically a blocker – especially since this is intended to be backported – as this logging would be activated in *any* production environment and could only be deactivated by manually `unset()`ing this default config.
  18. Markus Klein commented on patch set 7 07/30/25, 21:29

    DefaultConfiguration.php:1648 Reply

    > As an intergrator I would expect for this processor to only be activated if I as an intergrator asked for DEBUG logs. How do you come to this conclusion? How do you know that? I would actually assume the exact opposite: Integrators are aware how the config works and that any config is valid all levels up. That said, I agree we should add this only from `Warning` upwards.
  19. Benjamin Franzke commented on patch set 7 07/31/25, 06:26

    DefaultConfiguration.php:1648 Reply Unresolved

    > How do you come to this conclusion? How do you know that? As I wrote "I would expect", because that's what makes most sense. And you actually confirm that with this sentence: > That said, I agree we should add this only from Warning upwards. So what I meant was: As an integrator I do not want to configure processors, I want to configure *what* is logged, and would expect a debugging oriented processor to only chime in if I configured debug-logs. Our problem is, that our configuration and logging-pipeline is too low-level, as we configure log-levels for "writers" and not abstract debugging "levels", that are honored by processors and by writers, therefore an integrator basically has to configure too many low-level places.
  20. Amir Arends commented on patch set 7 07/31/25, 06:57

    Indeed, I don’t think introducing of processors here is necessary. The original issue was that the invoked URL wasn’t being persisted for some entries. That URL is now handled in my commit. Everything else is overdressed.
  21. Sebastian Michaelsen wrote 03/20/26, 08:31

    Removed reviewer Sebastian Michaelsen.
  22. Benni Mack wrote 04/21/26, 14:54

    Removed cc Benni Mack.
  23. Benni Mack updated the commit message in patch set 8 CR -1 V +1 04/22/26, 06:49

  24. core-ci voted on patch set 8 V -1 04/22/26, 11:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100806

  25. Christian Kuhn wrote 06/18/26, 23:04

    Removed cc Christian Kuhn.