php var_dump($object) or print_r($object) to a log file

前端 未结 4 586
挽巷
挽巷 2021-02-05 16:24

This question is generic, and I would simply like to know how to dump objects to log files. In order to clarify things, i am elaborating through an example.

I have been

4条回答
  •  清歌不尽
    2021-02-05 16:55

    Mage::log(
        $object->debug(), //Objects extending Varien_Object can use this
        Zend_Log::DEBUG,  //Log level
        'my.log',         //Log file name; if blank, will use config value (system.log by default)
        true              //force logging regardless of config setting
    );
    

提交回复
热议问题