logger = $logger; } /** * {@inheritDoc} */ protected function write(array $record) { if (isset($record['formatted'])) { $logRecord = json_decode($record['formatted'], true); } if (empty($logRecord)) { $logRecord = $record['context']; $logRecord['level'] = Logger::getLevelName($record['level']); $logRecord['message'] = $record['message']; } $this->logger->post($record['channel'], $logRecord); } }