1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-22 05:52:31 +01:00
Bryan Davis 4e69837afc Optionally reduce timestamp resolution for performance
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
2015-10-25 15:13:43 -06:00
..