Breaking: #110218 - Class LogRecord declared final
See forge#110218
Description
The PHP class
\TYPO3\ — the value object passed
to log writers and processors — has been declared
final
and is now
instantiated directly via
new
within
\TYPO3\, instead of using
General.
A log record is a plain data transfer object created for every single log
entry. Routing its creation through
make 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_ and uses native
type declarations for all method signatures instead of loose PHPDoc
annotations.
Impact
Extending or XCLASSing
Log is not possible anymore. Extension
classes will raise a fatal PHP error, XCLASS configurations for this class
are silently ignored.
Calling a method of
Log with a wrong argument type — for
example a non-float value for
set — will raise a PHP
\Type, depending on the
strict_ mode of the
calling code.
Creating, reading and modifying log records — for example in custom
implementations of
\TYPO3\ or
\TYPO3\ — continues to work as
before.
Affected installations
TYPO3 installations with third-party extensions that extend or XCLASS the
class
Log, which is very unlikely.
Migration
To enrich or modify log records, implement a custom log processor
(
Processor), which may return a modified or newly created
Log instance. Custom output handling belongs into a log writer
(
Writer).