Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Documentation/ApiOverview/Logging/Processors/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace MyVendor\MyExtension\Log\Processor;

use TYPO3\CMS\Core\Log\LogRecord;

class MyProcessor extends \TYPO3\CMS\Core\Log\Processor\AbstractProcessor
{
protected bool $option = true;

public function setOption(bool $option): void
{
$this->option = $option;
}

public function processLogRecord(LogRecord $logRecord): LogRecord
{
// add magic

return $logRecord;
}
}