mirror of
https://github.com/Seldaek/monolog.git
synced 2025-02-22 05:52:31 +01:00
Introduce a new `useMicrosecondTimestamps()` method to Logger that allows runtime selection of whether or not to create microsecond resolution timestamps for log records. 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 `new DateTime` to capture a second resolution timestamp in systems which generate a large number of log events. The default behavior of generating high precision timestamps remains the same, but may be changed in a future release. Users requiring high precision timestamps are encouraged to explicitly call `Monolog\Logger::useMicrosecondTimestamps(true)` in their setup code. Closes #657