Skip to content

Commit

Permalink
Fix deprecation warning on PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 14, 2021
1 parent 2209ddd commit 2e37d0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Monolog/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function addRecord($level, $message, array $context = array())
if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
$ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
} else {
$ts = new \DateTime(null, static::$timezone);
$ts = new \DateTime('now', static::$timezone);
}
$ts->setTimezone(static::$timezone);

Expand Down

0 comments on commit 2e37d0b

Please sign in to comment.