69401[TASK] Fully implement PSR-3
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 5
Review log 2228
Show 3 earlier messages
-
crell uploaded patch set 1 06/05/21, 00:08
-
crell marked it work in progress 06/05/21, 00:09
-
crell commented on patch set 1 06/05/21, 00:13
This change is ready for review.Right now, this just adds PSR-3 interpolation to the database writer/UI. If we decide to go this route, I'll update the other writers next week. Once that's done we'd have to go through all log uses in the system and change them to use proper static strings, per spec. For reference, I'm working on updating PSR-3 to use PHP 8 types. That work includes introducing a metadocument, which includes the background on string interpolation: https://github.com/php-fig/fig-standards/pull/1231 The various log classes have other refactoring they definitely need, but this gets us started with spec compliance at least. I am tempted to go ahead and fully rename details->message and data->context to be more consistent with the spec, but I'm not 100% certain what knock on effects that may have. If someone with more context (no pun intended) can indicate that should be safe, I can work that in as well.
-
core-ci voted on patch set 1 V -1 06/05/21, 00:18 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12172
-
crell uploaded patch set 2 06/07/21, 15:35
-
core-ci voted on patch set 2 V +1 06/07/21, 15:46 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12196
-
Markus Klein commented on patch set 2 06/07/21, 17:51
BackendLogController.php:63is it really needed here? USdateFormat is set in the DefaultConfiguration, if someone manages to unset this, a small slap from PHP is okayLogEntry.php:43wouldn't do that with this patch, if it is also targeted for v10.LogEntryTest.php:63change the name as well, if we do not use serialize anymore? -
crell uploaded patch set 3 06/07/21, 19:08
-
Markus Klein commented on patch set 3 06/07/21, 19:15
My other comments are still open.LogEntryTest.php:63ReplyDone -
core-ci voted on patch set 3 V +1 06/07/21, 19:20 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12199
-
crell commented on patch set 3 06/07/21, 19:21
BackendLogController.php:63ReplyI don't know what all is and isn't trustworthy to set in the globals; my natural inclination is to not trust that anything in an array is set correctly.LogEntry.php:43ReplyHm, I think I have some other 7.4-targeted syntax in here, like null-coalesce-assign, so maybe I shouldn't include v10 in this. I just checked with Benni and he said to ignore v10, so I'll note that in the summary.LogEntryTest.php:63ReplyAck -
Markus Klein commented on patch set 3 06/07/21, 20:33
BackendLogController.php:63ReplyAckLogEntry.php:43Replyfine with me then -
Markus Klein voted on patch set 3 CR +1 06/07/21, 20:33
-
Markus Klein commented on patch set 3 CR 0 06/07/21, 20:38
Sorry one more commentLogEntry.php:401I am a big fan of "escape stuff when I know the context". Escaping things here without having a clue whether this is used in HTML context at all seems somehow wrong to me. -
crell commented on patch set 3 06/07/21, 21:01
LogEntry.php:401ReplyI agree. This is specifically for use with the HTML output of the log table display. For outputting to the syslog or file log or stuff like that, we'd escape differently. Is there a better place to put this logic? (This seemed like the most central place to do so without having to get into doing this logic in Fluid, which seemed worse.) -
Tymoteusz Motylewski commented on patch set 3 06/08/21, 06:11
LogEntry.php:401Replywhere its being used in fluid? -
crell commented on patch set 3 06/08/21, 17:44
LogEntry.php:401ReplyI'll be honest, I got lost in the layers between LogEntry and the actual display logic. BackendLogController pulls them out of the repository, then groups them, then passes them off to the view object. I'm not entirely clear which layer does what between there and Resources/Partials/Conent/LogEntries.html. That's part of why I put it where I did, because I knew it would work there. Hm, although digging through it again, I *think* It happens in FormatDetailsViewHelper::renderStatic()? Where it's already doing some kind of replacement, just... the wrong one. Should I try to modify that to do the correct interpolation instead? -
Markus Klein commented on patch set 3 06/08/21, 19:22
LogEntry.php:401ReplyI guess something is not entirely clear. The belog extension displays log records from the table sys_log. This has *nothing* to do with PSR-3 logging, this is old legacy logging. The Core, by default, uses the PSR-3 Logging API only to write to log files, never to database. So there is no UI to display things. -
crell commented on patch set 3 06/08/21, 20:27
LogEntry.php:401Reply... Huh? They both look like they work off of sys_log. Why does DatabaseWriter exist if it's not used? You're saying there's two independent and incompatible logging frameworks in here, sharing the same database? -
Markus Klein commented on patch set 3 06/08/21, 20:53
LogEntry.php:401Reply UnresolvedI double-checked now. DatabaseWriter is indeed used for one very specific case: typo3/sysext/core/Configuration/DefaultConfiguration.php:1469 which is triggered only here: typo3/sysext/core/Classes/Resource/ResourceStorage.php:267 The general purpose DatabaseWriter was introduced together with the initial logging framework (the thing configured via TYPO3_CONF_VARS|LOG). It may be used by an integrator, but is not used by the Core's default configuration (except the one instance mentioned above). The sys_log table exists basically since every and is written mostly via \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::writelog(). We aim to remove all this legacy logging stuff and replace it with the logging framework, but that's already taking years, and will probably take some more. (my personal expectation) One reason, IMHO, is that the logging framework should be extended by some features, as we documented in https://wiki.typo3.org/Blueprints/Logging. Once we got that one in place, we should be able to easily replace the old logging stuff. -
crell rebased onto patch set 4 06/11/21, 20:21
-
core-ci voted on patch set 4 V +1 06/11/21, 20:31 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12321
-
Benni Mack uploaded patch set 5 06/12/21, 20:56
-
core-ci voted on patch set 5 V -1 06/12/21, 20:59 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12346
-
Benni Mack uploaded patch set 6 06/12/21, 21:01
-
core-ci voted on patch set 6 V +1 06/12/21, 21:10 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/12347
-
Markus Klein commented on patch set 6 06/14/21, 07:10
Is the commit message wrong now? Because only belog-files are touched? -
crell abandoned the change 06/15/21, 16:21
This conflates the old logging table with the new logging system in a bad way. A step-wise approach is being pursued elsewhere.