28 lines
658 B
PHP
28 lines
658 B
PHP
<?php
|
|
|
|
namespace KupShop\KupShopBundle\Util\Logging;
|
|
|
|
use KupShop\KupShopBundle\Util\StringUtil;
|
|
use Monolog\Formatter\FormatterInterface;
|
|
|
|
class GelfHandler extends \Monolog\Handler\GelfHandler
|
|
{
|
|
protected function getDefaultFormatter(): FormatterInterface
|
|
{
|
|
return new GelfFormatter();
|
|
}
|
|
|
|
public function isHandling(array|\Monolog\LogRecord $record): bool
|
|
{
|
|
if (!parent::isHandling($record)) {
|
|
return false;
|
|
}
|
|
|
|
if (($record['channel'] ?? null) == 'cache' && StringUtil::startsWith($record['message'], 'Failed to save key')) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|