ContextKeyFilterProcessor.php in Monolog 2.x
File
src/Logger/Processor/ContextKeyFilterProcessor.php
View source
<?php
namespace Drupal\monolog\Logger\Processor;
use Monolog\Processor\ProcessorInterface;
class ContextKeyFilterProcessor implements ProcessorInterface {
protected $contextKeys;
public function __construct(array $contextKeys = []) {
$this->contextKeys = $contextKeys;
}
public function __invoke(array $record) {
foreach ($this->contextKeys as $key) {
if (isset($record['context'][$key])) {
unset($record['context'][$key]);
}
}
return $record;
}
}