Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/utility/logger.php
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Line(s) | |||||
const LI_FRONT = 1; | const LI_FRONT = 1; | ||||
/** | /** | ||||
* Log interface: Admin | * Log interface: Admin | ||||
*/ | */ | ||||
const LI_ADMIN = 2; | const LI_ADMIN = 2; | ||||
/** | /** | ||||
* Log interface: Cron (Front) | * Log interface: CLI | ||||
*/ | */ | ||||
const LI_CRON_FRONT = 3; | const LI_CLI = 3; | ||||
/** | |||||
* Log interface: Cron (Admin) | |||||
*/ | |||||
const LI_CRON_ADMIN = 4; | |||||
/** | /** | ||||
* Log interface: API | * Log interface: API | ||||
*/ | */ | ||||
const LI_API = 5; | const LI_API = 5; | ||||
/** | /** | ||||
* Log notification status: disabled | * Log notification status: disabled | ||||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | |||||
'LogUserId' => USER_GUEST, | 'LogUserId' => USER_GUEST, | ||||
'IpAddress' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', | 'IpAddress' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '', | ||||
'LogSessionKey' => 0, | 'LogSessionKey' => 0, | ||||
'LogProcessId' => getmypid(), | 'LogProcessId' => getmypid(), | ||||
'LogUserData' => '', | 'LogUserData' => '', | ||||
'LogNotificationStatus' => self::LNS_DISABLED, | 'LogNotificationStatus' => self::LNS_DISABLED, | ||||
); | ); | ||||
if ( $this->Application->isAdmin ) { | if ( $this->Application->isWebRequest() ) { | ||||
$this->_logRecord['LogInterface'] = defined('CRON') && CRON ? self::LI_CRON_ADMIN : self::LI_ADMIN; | $this->_logRecord['LogInterface'] = $this->Application->isAdmin ? self::LI_ADMIN : self::LI_FRONT; | ||||
} | } | ||||
else { | else { | ||||
$this->_logRecord['LogInterface'] = defined('CRON') && CRON ? self::LI_CRON_FRONT : self::LI_FRONT; | $this->_logRecord['LogInterface'] = self::LI_CLI; | ||||
} | } | ||||
if ( $this->Application->InitDone ) { | if ( $this->Application->InitDone ) { | ||||
$this->_logRecord['LogUserId'] = $this->Application->RecallVar('user_id'); | $this->_logRecord['LogUserId'] = $this->Application->RecallVar('user_id'); | ||||
if ( $this->Application->isWebRequest() ) { | |||||
$this->_logRecord['LogSessionKey'] = $this->Application->GetSID(); | $this->_logRecord['LogSessionKey'] = $this->Application->GetSID(); | ||||
} | |||||
$this->_logRecord['IpAddress'] = $this->Application->getClientIp(); | $this->_logRecord['IpAddress'] = $this->Application->getClientIp(); | ||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | /** | ||||
* Sets one or more fields of log record | * Sets one or more fields of log record | ||||
▲ Show 20 Lines • Show All 1077 Lines • Show Last 20 Lines |