mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-20 16:16:37 +02:00
Fix microseconds support on 7.1, and enable it by default as 7.1 has no perf cost anymore
This commit is contained in:
@@ -128,7 +128,7 @@ class Logger implements LoggerInterface
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $microsecondTimestamps = false;
|
||||
protected $microsecondTimestamps = true;
|
||||
|
||||
/**
|
||||
* @var DateTimeZone
|
||||
@@ -251,13 +251,17 @@ class Logger implements LoggerInterface
|
||||
* Control the use of microsecond resolution timestamps in the 'datetime'
|
||||
* member of new records.
|
||||
*
|
||||
* Generating microsecond resolution timestamps by calling
|
||||
* On PHP7.0, generating microsecond resolution timestamps by calling
|
||||
* microtime(true), formatting the result via sprintf() and then parsing
|
||||
* the resulting string via \DateTime::createFromFormat() can incur
|
||||
* a measurable runtime overhead vs simple usage of DateTime to capture
|
||||
* a second resolution timestamp in systems which generate a large number
|
||||
* of log events.
|
||||
*
|
||||
* On PHP7.1 however microseconds are always included by the engine, so
|
||||
* this setting can be left alone unless you really want to suppress
|
||||
* microseconds in the output.
|
||||
*
|
||||
* @param bool $micro True to use microtime() to create timestamps
|
||||
*/
|
||||
public function useMicrosecondTimestamps(bool $micro)
|
||||
|
Reference in New Issue
Block a user