Review main Abandoned

70163[WIP][TASK] Use PSR-3 logging in DataHandler

Benni Mack CR 0 V 0 Hard +283 −5 updated 03/23/24, 20:54

Commit message

This change introduces default loggers registered
in EXT:core's Services.yaml to be used throughout
core in order to replace sys_log logging.

The idea is the following:
1. Registration of loggers (= channels) in Services.yaml to allow
them to be used as DI. Should be handled in a compiler-pass of course in the future
2. Configuration of the loggers for site admins

As you see, the logging configuration in DefaultConfiguration.php
stinks massively, as one would first need to define the log level
and THEN the writer, whereas the other way around (= Writer, which can
be limited to a certain log level).

For such a use case, a specific writer should be fine, as
the main focus is on the usage of existing loggers,
and their writer configuration.

The new loggers are generic enough to be used in various
places and wired to a custom Typo3DatabaseLogWriter
to replace the existing $BE_USER->writeLog() logic
by enriching the DB table entries with the needed
context information.

String-replacement is now done via {} instead of %s,
however this is not done for the content logger yet (TODO).

All relevant data is now stored json_encoded instead of
serialized().

Also, processors should be used to enrich data for these new
channels.

It is obvious that
* defining loggers / channels should be handled in DI
* defining writer configuration for loggers should be handled per installation (either LocalConfiguration or any other place)
* when debugging LogManager in a regular backend call, having separate channels for each class is a BUTT load of overhead in terms of PHP objects

Review

  • Code review CR 0
  • Verified V 0

Files 5

Review log 69

  1. Benni Mack uploaded patch set 1 07/30/21, 14:21

  2. core-ci voted on patch set 1 V -1 07/30/21, 14:42 Core CI is not happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/13925

  3. Benni Mack wrote 11/29/21, 10:10

    Change destination moved from master to main
  4. Benni Mack updated the commit message in patch set 2 11/29/21, 13:29

  5. core-ci voted on patch set 2 V -1 11/29/21, 18:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20040

  6. Benni Mack uploaded patch set 3 03/09/22, 21:11

  7. core-ci voted on patch set 3 V -1 03/09/22, 21:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24772

  8. Benni Mack marked it work in progress 03/11/22, 18:56

  9. Benni Mack abandoned the change 03/23/24, 20:54