Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53a637c

Browse files
bytestreamfabpot
authored andcommitted
[Mailer] Add timestamp to SMTP debug log
1 parent a70414a commit 53a637c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/Mailer/Transport/Smtp/Stream/AbstractStream.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ abstract class AbstractStream
3636
public function write(string $bytes, bool $debug = true): void
3737
{
3838
if ($debug) {
39+
$timestamp = date('c');
3940
foreach (explode("\n", trim($bytes)) as $line) {
40-
$this->debug .= sprintf("> %s\n", $line);
41+
$this->debug .= sprintf("[%s] > %s\n", $timestamp, $line);
4142
}
4243
}
4344

@@ -91,7 +92,7 @@ public function readLine(): string
9192
}
9293
}
9394

94-
$this->debug .= sprintf('< %s', $line);
95+
$this->debug .= sprintf('[%s] < %s', date('c'), $line);
9596

9697
return $line;
9798
}

0 commit comments

Comments
 (0)