Skip to content

Commit e1028bc

Browse files
authored
Merge pull request #107 from colinmollenhour/colinmollenhour-patch-1
Session should never be started by logger. Fixes #106
2 parents da881cb + e084a23 commit e1028bc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/app/code/community/FireGento/Logger/Model/Logstash.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ protected function buildJSONMessage($event, $enableBacktrace = false)
107107
/** this prevents different datatypes as getHttpHost() returns either string or boolean (false) */
108108
$fields['HttpHost'] = (!Mage::app()->getRequest()->getHttpHost()) ? 'cli': Mage::app()->getRequest()->getHttpHost();
109109
$fields['LogFileName'] = $this->_logFileName;
110-
/** This is to prevent infinite loops with Cm_Redis_Session because the constructor calls the logging if
111-
* log_level >= Zend_Log::Debug */
112-
if ((int) Mage::getConfig()->getNode('global/redis_session')->descend('log_level') < Zend_Log::DEBUG) {
110+
// Only add session fields if a session was already instantiated and logger should not start a new session
111+
if (isset($_SESSION)) {
113112
$fields['SessionId'] = Mage::getSingleton("core/session")->getEncryptedSessionId();
114113
$fields['CustomerId'] = Mage::getSingleton('customer/session')->getCustomerId();
115114
}

0 commit comments

Comments
 (0)