Skip to content

Commit

Permalink
Merge pull request #113 from firegento/develop
Browse files Browse the repository at this point in the history
Publish release for JsonStream fixes.
  • Loading branch information
therouv authored Mar 27, 2018
2 parents 102b79c + b1165e3 commit ec1f61f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/code/community/FireGento/Logger/Model/JsonStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @package FireGento_Logger
* @author FireGento Team <[email protected]>
*/
class FireGento_Logger_Model_Stream extends Zend_Log_Writer_Stream
class FireGento_Logger_Model_JsonStream extends Zend_Log_Writer_Stream
{
/**
* @var bool
Expand Down Expand Up @@ -73,10 +73,10 @@ protected function _write($event)
$event = Mage::helper('firegento_logger')->getEventObjectFromArray($event);
Mage::helper('firegento_logger')->addEventMetadata($event, NULL, $this->_enableBacktrace);
$eventData = $event->getEventDataArray();
$eventData = array_filter($eventData, 'is_null');
$eventData = array_filter($eventData, function ($var) { return $var !== null; });
$line = @json_encode($eventData);

if (false === @fwrite($this->_stream, $line)) {
if (false === @fwrite($this->_stream, $line . PHP_EOL)) {
//require_once 'Zend/Log/Exception.php';
throw new Zend_Log_Exception("Unable to write to stream");
}
Expand Down

0 comments on commit ec1f61f

Please sign in to comment.