Skip to content

Commit

Permalink
Update SF
Browse files Browse the repository at this point in the history
  • Loading branch information
GDXbsv committed Jan 16, 2025
1 parent b77ca25 commit 8a194c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/LogstashFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public function format(LogRecord $record): string
if (empty($data['datetime'])) {
$data['datetime'] = gmdate('c');
}
/** @psalm-suppress RiskyTruthyFalsyComparison this is okay null or empty string */
if (empty($data['timestamp'])) {
$data['timestamp'] = time();
}
$message = [
'@timestamp' => $data['datetime'],
'@version' => 1,
Expand Down

0 comments on commit 8a194c7

Please sign in to comment.