NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Log Profiler


Joined: 27 May 2021
Posts: 6
Reply with quote
Is it possible to write the output of the profiler to a log via php functions?
View user's profileFind all posts by hanseisSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
yes if you mean line profiler.
In this case you can add script in php.ini that will run _after_ each request. In this script you'll collect profiler results and send them wherever you want.
API is not well documented, but you'll figure out how it works -- it's very simple
Start here: http://forum.nusphere.com/howto-get-results-from-dbg-get-profiler-results-t1848.html

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 May 2021
Posts: 6
Reply with quote
Hi Dimitri,
Thanks for your info but I don't understand where in your example a script is called from php.ini that then writes the log. I made the settings in php.ini and call the following in my php script.
Code:
$result = null;
dbg_get_profiler_results( $result );

$result remains empty though. How do I get the profiler data?
View user's profileFind all posts by hanseisSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
$result = dbg_get_profiler_results(); would do.
Note: you still need IDE running and you still need to run HTTP request or CLI command to launch your script with DBGSESSID argument to tell debugger you want to run profiler.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 27 May 2021
Posts: 6
Reply with quote
Thanks for the tip, that works
View user's profileFind all posts by hanseisSend private message
Log Profiler
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic