Breaking: #110218 - Class LogRecord declared final 

See forge#110218

Description 

The PHP class \TYPO3\CMS\Core\Log\LogRecord — the value object passed to log writers and processors — has been declared final and is now instantiated directly via new within \TYPO3\CMS\Core\Log\Logger , instead of using GeneralUtility::makeInstance() .

A log record is a plain data transfer object created for every single log entry. Routing its creation through makeInstance() allowed the class to be overridden via XCLASS, but caused an unnecessary container lookup in one of the most frequently executed code paths of the logging API.

In addition, the class now declares strict_types and uses native type declarations for all method signatures instead of loose PHPDoc annotations.

Impact 

Extending or XCLASSing LogRecord is not possible anymore. Extension classes will raise a fatal PHP error, XCLASS configurations for this class are silently ignored.

Calling a method of LogRecord with a wrong argument type — for example a non-float value for setCreated() — will raise a PHP \TypeError , depending on the strict_types mode of the calling code.

Creating, reading and modifying log records — for example in custom implementations of \TYPO3\CMS\Core\Log\Processor\ProcessorInterface or \TYPO3\CMS\Core\Log\Writer\WriterInterface — continues to work as before.

Affected installations 

TYPO3 installations with third-party extensions that extend or XCLASS the class LogRecord , which is very unlikely.

Migration 

To enrich or modify log records, implement a custom log processor ( ProcessorInterface ), which may return a modified or newly created LogRecord instance. Custom output handling belongs into a log writer ( WriterInterface ).