admin管理员组文章数量:1384497
Sometimes, I write info to the debug log to diagnose problems. While working on a performance problem, resolution to hours:minutes:seconds is not enough. I'd like to get to milliseconds, but haven't yet found the place to make the change. Ideas?
FWIW, this is what the default timestamp looks like: [08-May-2020 23:16:38 UTC]
THANKS for any advice.
Sometimes, I write info to the debug log to diagnose problems. While working on a performance problem, resolution to hours:minutes:seconds is not enough. I'd like to get to milliseconds, but haven't yet found the place to make the change. Ideas?
FWIW, this is what the default timestamp looks like: [08-May-2020 23:16:38 UTC]
THANKS for any advice.
Share Improve this question asked May 8, 2020 at 23:50 Bob EastonBob Easton 1231 silver badge7 bronze badges1 Answer
Reset to default 0WordPress does not manage the format of the timestamp. Instead, WordPress hands off error message contents to the PHP function error_log(), which creates the timestamp.
Finding no easy way to ask error_log() for higher resolution timestamp, combined with the fact that I'm creating the message content myself, I've added a microsecond string ahead of my messages, essentially like this:
error_log( gettimeofday()['usec'] . ' ' . $message );
本文标签: phpHow can precision be improved for the debug log timestamp
版权声明:本文标题:php - How can precision be improved for the debug log timestamp? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744489281a2608637.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论