How to change the date format of Zend_Log?
Now, before each new journal entry, a date with a time stamp is added:
"2013-01-28T16: 47: 54 + 01: 00 ... some kind of journal message ..."
But I would like to format this date as:
"Ymd H: i: s ... some kind of log message ..."
My code is as follows:
class Game_Logger { public function __construct($val, $txt = null) { $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/../log/log.log'); $logger = new Zend_Log($writer); if (is_array($val)) { $output = Zend_Debug::dump($val, null, false); } else { $output = $val; } if($txt){ $output = $txt.' '.$output; } $logger->info($output); } }
source share