CodeIgniter Forums
The change on debugbar logging requests - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: The change on debugbar logging requests (/showthread.php?tid=81113)



The change on debugbar logging requests - demirkaric - 01-25-2022

Currently in the file vendor/codeigniter4/framework/system/Debug/Toolbar.php
In the method prepare() for generating debugbar_*.json  and history tracking the method time() is used.  

This con of using time() is that if we have multiple requests the file will get overwriten in the exact same second and the debugbar won't show all requests but only the last request.

My suggestion is using microtime() or something like random string that will be generated in the name of the file, thus we will have all logged requests in the debugbar.

Also when multiple developers works on different modules I suggest the option that developers can filter requests by session so that everyone can see it's own requests made by their browser.


RE: Show time() in microtime - paulbalandan - 01-25-2022

I think you're looking for microtime(true)

https://www.php.net/manual/en/function.microtime.php


RE: Show time() in microtime - demirkaric - 01-27-2022

(01-25-2022, 06:50 PM)paulbalandan Wrote: I think you're looking for microtime(true)

https://www.php.net/manual/en/function.microtime.php

Just preformulated the request.


RE: The change on debugbar logging requests - kenjis - 01-27-2022

This is reasonable.
Why don't you send a PR?
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md


RE: The change on debugbar logging requests - kilishan - 01-27-2022

These are both good suggestions. We'd love it if you could submit those changes!


RE: The change on debugbar logging requests - maniaba - 02-02-2022

Just submitted PR https://github.com/codeigniter4/CodeIgniter4/pull/5643