Skip to content

Commit

Permalink
fix(logging): don't encode additionalData additionally
Browse files Browse the repository at this point in the history
  • Loading branch information
das-nagnag committed Jun 13, 2024
1 parent 65a569e commit 0933dda
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Classes/Backend/JSONConsoleLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace t3n\FlowLog\Backend;

use Google\Cloud\BigQuery\Date;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\Backend\ConsoleBackend;

Expand Down Expand Up @@ -62,12 +61,12 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat
'service' => $this->serviceContext['service'],
'version' => $this->serviceContext['version'],
'message' => $message,
'additionalData' => json_encode($additionalData, JSON_THROW_ON_ERROR),
'date' => new Date(new \DateTime('now')),
'additionalData' => $additionalData,
'date' => (new \DateTime('now'))->format('Y-m-d'),
'datetime' => new \DateTime('now')
];
$output = json_encode($data);
} catch (Exception $e) {
} catch (\Exception $e) {
$data = [
'severity' => $this->severityLabels[LOG_WARNING],
'service' => $this->serviceContext['service'],
Expand All @@ -80,7 +79,7 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat
],
'stackTrace' => $e->getTraceAsString()
],
'date' => new Date(new \DateTime('now')),
'date' => (new \DateTime('now'))->format('Y-m-d'),
'datetime' => new \DateTime('now')
];
$output = json_encode($data);
Expand Down

0 comments on commit 0933dda

Please sign in to comment.