-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from firegento/develop
Publish release for JsonStream fixes.
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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"); | ||
} | ||
|