Issue Task Closed

#104477Remove the hyphen as prefix for log context data in the DatabaseWriter

Andy Abderhalden 07/25/24, 11:12 updated 12/02/25, 14:33

Description

According to PSR-3, additional “context” data can be logged as an array, which is converted to json by the DatabaseWriter.

The DatabaseWriter adds a “-” prefix to each json string that is persisted.
The same thing happens in the FileWriter for better log parsing (I think?), but it doesn’t make sense in the DatabaseWriter because the context data is persisted in a separate column.

I suggest removing the hyphen from line 82. It will then be easier to interpolate the context data in custom “logviewer” applications.
https://github.com/TYPO3/typo3/blob/12.4/typo3/sysext/core/Classes/Log/Writer/DatabaseWriter.php

Reviews 2