开发者

Stack trace for sql query execution? (Zend Framework)

开发者 https://www.devze.com 2023-01-31 02:24 出处:网络
Is there a way to get the stack trace for each sql query using the db profiler? I\'m using the profiler like so:

Is there a way to get the stack trace for each sql query using the db profiler?

I'm using the profiler like so:

foreach($profiler->getQueryProfiles() as $query) {

}

Which is fine as I ca开发者_运维技巧n get elapsed seconds, actual query etc but I want to know where this query was called from so I need the last 3 or 4 items in the stack trace.

Any ideas?


Extend Zend_Db_Profiler and use debug_backtrace() in the queryEnd method.

0

精彩评论

暂无评论...
验证码 换一张
取 消