public function actionShutDown() { /* * 打印统计日志字段 */ $arrLog = array(); $arrUserInfo = Saf_Action_SessionAction::getUserInfo(); if (count($arrUserInfo) > 0) { //$arrLog['uid'] = intval($arrUserInfo['uid']);//uid字段是omp字段,wf和notice日志都需要打印 $arrLog['un'] = strval($arrUserInfo['uname']); $arrLog['mobilephone'] = strval($arrUserInfo['securemobil']); $arrLog['email'] = strval($arrUserInfo['secureemail']); } else { $arrLog['uid'] = 0; $arrLog['un'] = ''; $arrLog['mobilephone'] = ''; $arrLog['email'] = ''; } $arrLog['baiduid'] = isset($_COOKIE['BAIDUID']) ? $_COOKIE['BAIDUID'] : ''; $arrLog['url'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; $arrLog['refer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $arrLog['uip'] = Bd_Env::getUserIp(); $arrLog['ua'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; $arrLog['host'] = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; self::setLogNotice($arrLog); //结束OMP $arrPublic = Saf_Action_PublicAction::getPublic(); $objOmp = $arrPublic['omp']; if (is_object($objOmp)) { $objOmp->stop(); } //打印notice日志 self::saveLogNotice(); }
private static function _getLogString($current_args) { $str = 'PROFILER: ' . strftime('%m-%d %H:%M:%S') . ' ' . $current_args['module'] . ' * ' . posix_getpid(); $str .= ' [logid=' . (defined('LOG_ID') ? LOG_ID : Bd_Env::getLogID()); $args = array(); foreach ($current_args as $key => $value) { $args[] = rawurlencode($key) . '=' . rawurlencode($value); } $str .= ' ' . implode(' ', $args) . "]\n"; return $str; }