本文整理汇总了PHP中ZLog::logger方法的典型用法代码示例。如果您正苦于以下问题:PHP ZLog::logger方法的具体用法?PHP ZLog::logger怎么用?PHP ZLog::logger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZLog
的用法示例。
在下文中一共展示了ZLog::logger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLogger
/**
* Returns the logger object. If no logger has been initialized, FileLog will be initialized and returned.
*
* @access private
* @return Log
* @throws Exception thrown if the logger class cannot be instantiated.
*/
private static function getLogger()
{
if (!self::$logger) {
global $specialLogUsers;
// This variable comes from the configuration file (config.php)
$logger = LOGBACKEND_CLASS;
if (!class_exists($logger)) {
$errmsg = 'The configured logging class `' . $logger . '` does not exist. Check your configuration.';
error_log($errmsg);
throw new \Exception($errmsg);
}
list($user) = Utils::SplitDomainUser(strtolower(Request::GetGETUser()));
$user = '[' . $user . ']';
self::$logger = new $logger();
self::$logger->SetUser($user);
self::$logger->SetAuthUser(Request::GetAuthUser());
self::$logger->SetSpecialLogUsers($specialLogUsers);
self::$logger->SetDevid('[' . Request::GetDeviceID() . ']');
self::$logger->SetPidstr('[' . str_pad(@getmypid(), 5, " ", STR_PAD_LEFT) . ']');
self::$logger->AfterInitialize();
}
return self::$logger;
}