Reputation: 2817
I am currently using Zend framework 3 with zend log module. I noticed the Timestamp
column of zend log table is not unix timestamp.
I have tried to search solution but all I could see the way to change format. It there a way to change it and store to unix timestamp?
Upvotes: 0
Views: 40
Reputation: 2505
You can set your prefered time using setDateTimeFormat()
to Formatter, as in below-
$logger = new \Zend\Log\Logger();
$formatter = new \Zend\Log\Formatter\Simple();
$formatter->setDateTimeFormat('Y-m-d'); // as per your choice
$writer = new \Zend\Log\Writer\Stream('php://output');
$writer->setFormatter($formatter);
$logger->addWriter($writer);
Upvotes: 0