2024-04-02 13:50:08 -03:00
|
|
|
<?php
|
|
|
|
namespace Incoviba\Common\Implement\Log;
|
|
|
|
|
|
|
|
use Monolog\Formatter\JsonFormatter;
|
|
|
|
use Monolog\LogRecord;
|
|
|
|
|
|
|
|
class PDOFormatter extends JsonFormatter
|
|
|
|
{
|
|
|
|
public function __construct(int $batchMode = self::BATCH_MODE_JSON, bool $appendNewline = false, bool $ignoreEmptyContextAndExtra = false, bool $includeStacktraces = true)
|
|
|
|
{
|
|
|
|
parent::__construct($batchMode, $appendNewline, $ignoreEmptyContextAndExtra, $includeStacktraces);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function format(LogRecord $record): string
|
|
|
|
{
|
2025-04-22 15:31:55 -04:00
|
|
|
$normalized = $this->normalize($record, $this->maxNormalizeDepth);
|
2024-04-02 13:50:08 -03:00
|
|
|
return $normalized['message'];
|
|
|
|
}
|
|
|
|
}
|