php 打印debug日志

A lesser known trick is that mod_php maps stderr to the Apache log. And, there is a stream for that,

so file_put_contents('/path/to/file.log', $foo . PHP_EOL, FILE_APPEND);; will nicely dump the value of $foo into the Apache error log.

 

转自: http://stackoverflow.com/questions/6079492/how-to-print-a-debug-log

posted @ 2016-04-05 18:01  圆旭  阅读(791)  评论(0编辑  收藏  举报