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.)

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)