dousui8263 2010-10-17 12:31
浏览 84
已采纳

PHP是否有像Ruby on Rails logger.info()这样的内置调试日志记录到development.log文件?

Does PHP have built-in debugging logging like Ruby on Rails logger.info() to a development.log file?

With PHP I'd like to look "under the hood" to see what's going on... pages served, query string values, etc.

I've Googled a bunch but can't find anything.

(I'm trying to port a web app from RoR to PHP because I need more execution speed.)

  • 写回答

1条回答 默认 最新

  • dongxi1879 2010-10-17 12:36
    关注

    PHP has

    • error_logSends an error message to the web server's error log, a TCP port or to a file and
    • trigger_errorGenerates a user-level error/warning/notice message

    which you can use to trigger and log the predefined error types, e.g.

    trigger_error( "Custom Warning", E_USER_WARNING );
    

    Third party libraries exists with

    You can configure various destinations to log to. Usage is via an OO interface:

    $logger->log('Informational message', Zend_Log::INFO);
    

    and there is also the Log4J inspired

    Apart from that there is XDebug and Zend Debugger. There is also a PECL extension with Advanced PHP Debugger (APD)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 表达式必须是可修改的左值
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题