Elmah For other PHP

孤街浪徒 提交于 2019-12-10 19:04:01

问题


Is there an Elmah equivalent for PHP in general, Symfony in particular?


回答1:


Symfony comes with a logging framework that can log to file or any other backend you care to give it. From my understanding of Elmah this is about as close as you can get - there's nothing with all the features available and integrated with frameworks such as Symfony.

Please see this chapter in the Symfony book for more information on Symfony's logging capabilities.




回答2:


For future reference, elmah.io can be used for PHP as well. We focus primarily on .NET, but some of our users use it for PHP as well. Take a look at the following example to start logging errors from PHP to elmah.io: https://github.com/elmahio/other-language-examples/blob/master/PHP/Logger.php

To make it clear, I'm the founder of elmah.io and elmah.io isn't affiliated with ELMAH in any way. We share the name, but the services are very different.




回答3:


error_log() writes to system log etc.

You can search in PEAR as well...




回答4:


I'd recommend PEAR::Log as recommended by @Jet, along with set_error_handler() and set_exception_handler().



来源:https://stackoverflow.com/questions/951472/elmah-for-other-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!