Skip to content

Instantly share code, notes, and snippets.

@berliozd
Last active April 16, 2018 20:11
Show Gist options
  • Save berliozd/7564e9047ff4cf5834c6064c86b21521 to your computer and use it in GitHub Desktop.
Save berliozd/7564e9047ff4cf5834c6064c86b21521 to your computer and use it in GitHub Desktop.
Custom home made logging
<?php
private function _log($message) {
$file = '/var/www/html/yonka/var/log/didier.log';
$writer = new \Zend_Log_Writer_Stream($file);
$format = '%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL;
$formatter = new \Zend_Log_Formatter_Simple($format);
$writer->setFormatter($formatter);
$logger = new \Zend_Log($writer);
$logger->log($message, 4);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment