简体   繁体   English

调试Cakephp

[英]Debugging Cakephp

I have an issue with my Cakephp application. 我的Cakephp应用程序有问题。 I find that once a day or maybe once every two days PHP will lock up and become unresponsive resulting the the process crashing and restarting. 我发现,每天一次或也许每两天一次,PHP将锁定并变得无响应,从而导致进程崩溃并重新启动。

From what i've read this may be caused by a method in an endless loop. 根据我的阅读,这可能是由一个无限循环中的方法引起的。 As the application is very large is there anyway that I can capture activity of all my users in logs and see what methods arent finishing. 由于应用程序非常大,因此无论如何我都可以在日志中捕获所有用户的活动并查看没有完成的方法。

If anyone can suggest plugins, components or methodologies that I could use to do something like this. 如果有人可以建议我可以用来做这样的事情的插件,组件或方法。 FYI I would like to avoid adding a log statement to every method in my application. 仅供参考,我想避免在我的应用程序的每个方法中添加一条日志语句。

Additional Info: 附加信息:

  1. Cakephp 2.1 Cakephp 2.1
  2. Error Message in PHP error logs: PHP Fatal error: PHP错误日志中的错误消息:PHP致命错误:

    Maximum execution time of 300 seconds exceeded in ...lib\\Cake\\Model\\Datasource\\CakeSession.php on line 609 第609行的... lib \\ Cake \\ Model \\ Datasource \\ CakeSession.php中超过了300秒的最大执行时间

Have you considered writing custom log methods and simply catching cakephp's exceptions / errors? 您是否考虑过编写自定义日志方法并仅捕获Cakephp的异常/错误? This would avoid you having to put log statements in every single place. 这样可以避免将日志语句放在每个地方。

http://book.cakephp.org/2.0/en/core-libraries/logging.html http://book.cakephp.org/2.0/en/core-libraries/logging.html

Depending on how large your application is you could look into implementing a nosql log system. 根据应用程序的大小,您可以考虑实施nosql日志系统。 couchbase with memcached ( http://www.couchbase.com/ ) to store all the logged events. 带memcached( http://www.couchbase.com/ )的ouchbase,用于存储所有记录的事件。 Might be preferred to cakephp default of storing all log information in a large text file. 在将所有日志信息存储在大文本文件中时,默认情况下,pakephp可能更受欢迎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM