Breaking: #88799 - Introduced PSR-3 compatible Logging API ¶
See Issue #88799
With the adaption of the PSR-3 standard some PHP code had to be changed in order to reach compliance. The key difference is that log levels are now represented by strings rather than numbers. Note that the order of log levels is not affected and stays the same.
The breaking changes mostly affect internal functionality and should not apply to third-party extensions.
now extends from the PSR-3 base class and therefore inherits the new definition
of the log levels (
) based on string values.
The signatures of following methods have been adjusted to accept the new
The internal storage of the log level inside
has been adjusted, consequently the methods
respectively accept and return
In case you have configured own logger or log targets, you have to adjust the integer level and use strings.
# old configuration $GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['Core']['writerConfiguration'] = [ 7 => [ \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [ 'logFile' => 'typo3temp/var/log/core.log' ] ], ]; # new configuration $GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['Core']['writerConfiguration'] = [ 'debug' => [ \TYPO3\CMS\Core\Log\Writer\FileWriter::class => [ 'logFile' => 'typo3temp/var/log/core.log' ] ], ];
In case you have used the constants like
you are fine and your config will work like before.
Affected Installations ¶
Any installation using third-party extensions interacting with the internals of the Logging API.
There are two easy ways to convert the integer to the string representation and vice versa:
Convert from integer to string:
$logLevel = LogLevel::getInternalName($logLevelAsNumber)
Convert from string to integer:
$logLevelAsNumber = LogLevel::normalizeLevel($logLevel)