diff --git a/src/Monolog/TelemetryProcessor.php b/src/Monolog/TelemetryProcessor.php index 0ce7ecc..0a9f799 100644 --- a/src/Monolog/TelemetryProcessor.php +++ b/src/Monolog/TelemetryProcessor.php @@ -4,6 +4,7 @@ namespace Spiral\Telemetry\Monolog; +use Monolog\LogRecord; use Monolog\Processor\ProcessorInterface; use Psr\Container\ContainerInterface; use Spiral\Telemetry\TracerInterface; @@ -15,8 +16,12 @@ public function __construct( ) { } - public function __invoke(array $record): array + public function __invoke(LogRecord|array $record): array { + if ($record instanceof LogRecord) { + $record = $record->toArray(); + } + $tracer = $this->container->get(TracerInterface::class); \assert($tracer instanceof TracerInterface);