Skip to content

Commit 37e1d60

Browse files
authored
Merge pull request #8 from AiAeForks/main
Add timestamp to embed
2 parents 63dff5d + b62c5d6 commit 37e1d60

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/DiscordHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use \Monolog\Logger;
99
use \Monolog\Handler\AbstractProcessingHandler;
1010
use Psr\Log\LogLevel;
11+
use Carbon\Carbon;
1112

1213
class DiscordHandler extends AbstractProcessingHandler
1314
{
@@ -115,6 +116,7 @@ protected function write($record): void
115116
$log['embeds'][] = [
116117
'title' => '**[' . now()->format('d.m.Y H:i:s') . ']** '.str($logLevelName)->lower()->ucfirst().' ' . $emoji.' '.$this->suffix,
117118
'description' => "```css\n" . str($message)->limit('4000') . '```',
119+
'timestamp' => Carbon::now()->format('Y-m-d\TH:i:sP'),
118120
'color' => 0xE74C3C,
119121
'fields' => $fields
120122
];

0 commit comments

Comments
 (0)