diff --git a/Documentation/ApiOverview/Logging/Processors/Index.rst b/Documentation/ApiOverview/Logging/Processors/Index.rst index 0377623c21..38691fc29d 100644 --- a/Documentation/ApiOverview/Logging/Processors/Index.rst +++ b/Documentation/ApiOverview/Logging/Processors/Index.rst @@ -157,6 +157,11 @@ It is suggested to extend the abstract class :t3src:`core/Classes/Log/Processor/AbstractProcessor.php` which allows you use configuration options by adding the corresponding properties and setter methods. +.. rubric:: Example + +.. literalinclude:: _MyProcessorWithOptions.php + :caption: EXT:my_extension/Classes/Log/Processor/MyProcessor.php + Please keep in mind that TYPO3 will silently continue operating, in case a log processor is throwing an exception while executing the :php:`processLogRecord()` method. diff --git a/Documentation/ApiOverview/Logging/Processors/_MyProcessorWithOptions.php b/Documentation/ApiOverview/Logging/Processors/_MyProcessorWithOptions.php new file mode 100644 index 0000000000..ee15af9751 --- /dev/null +++ b/Documentation/ApiOverview/Logging/Processors/_MyProcessorWithOptions.php @@ -0,0 +1,22 @@ +option = $option; + } + + public function processLogRecord(LogRecord $logRecord): LogRecord + { + // add magic + + return $logRecord; + } +}