• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP log_notice函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中log_notice函数的典型用法代码示例。如果您正苦于以下问题:PHP log_notice函数的具体用法?PHP log_notice怎么用?PHP log_notice使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了log_notice函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: log

 public function log($level, &$message) {
     switch ($level) {
         case LogHelper::LEVEL_DEBUG:
             log_debug($message);
             break;
         case LogHelper::LEVEL_INFO:
             log_info($message);
             break;
         case LogHelper::LEVEL_NOTICE:
             log_notice($message);
             break;
         case LogHelper::LEVEL_WARNING:
             log_warn($message);
             break;
         case LogHelper::LEVEL_ERROR:
             log_error($message);
             break;
         case LogHelper::LEVEL_CRITICAL:
             log_critical($message);
             break;
         case LogHelper::LEVEL_ALERT:
             log_alert($message);
             break;
         case LogHelper::LEVEL_EMERGENCY:
             log_emergency($message);
             break;
     }
 }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:Log4DrupalMessageListener.php


示例2: cache_unset

function cache_unset($cache_key)
{
    $cache_key = _cache_prepare_cache_key($cache_key);
    log_notice("cache", "unset cache key {$cache_key}");
    if (isset($GLOBALS['cache_local'][$cache_key])) {
        unset($GLOBALS['cache_local'][$cache_key]);
    }
    $remote_rsp = _cache_do_remote('unset', $cache_key);
    return array('ok' => 1);
}
开发者ID:jacques,项目名称:flamework,代码行数:10,代码来源:lib_cache.php


示例3: cache_unset

function cache_unset($key, $more = array())
{
    $key = _cache_prepare_key($key, $more);
    unset($GLOBALS['_cache_local'][$key]);
    if ($GLOBALS['_cache_hooks']['unset']) {
        return call_user_func($GLOBALS['_cache_hooks']['unset'], $key);
    }
    log_notice("cache", "unset {$key}");
    return array('ok' => 1, 'local' => 1);
}
开发者ID:whosonfirst,项目名称:flamework,代码行数:10,代码来源:lib_cache.php


示例4: export_cache_path_for_sheet

function export_cache_path_for_sheet(&$sheet, &$more)
{
    if (!isset($more['filename'])) {
        log_notice('export', 'missing filename for export path');
        return null;
    }
    $root = export_cache_root_for_sheet($sheet);
    $parts = array($root, $more['filename']);
    return implode(DIRECTORY_SEPARATOR, $parts);
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:10,代码来源:lib_export_cache.php


示例5: cache_memcache_set

function cache_memcache_set($cache_key, $data)
{
    if (!$data) {
        log_notice("cache", "missing data to set key {$cache_key}");
        return array('ok' => 0, 'error' => 'missing data');
    }
    $memcache = cache_memcache_connect();
    if (!$memcache) {
        return array('ok' => 0, 'error' => 'failed to connect to memcache');
    }
    $ok = $memcache->set($cache_key, serialize($data));
    return array('ok' => $ok);
}
开发者ID:jacques,项目名称:flamework,代码行数:13,代码来源:lib_cache_memcache.php


示例6: action

 /**
  * Action
  *
  * Actions handled by this page:
  *   logout
  *
  * @param string $action_name Action
  */
 function action($action_name)
 {
     switch ($action_name) {
         case "logout":
             // Logout
             log_notice("Logout", "User: " . $_SESSION['client']['userdbo']->getUsername() . " logged out");
             session_destroy();
             $this->gotoPage("home");
             break;
         default:
             // No matching action, refer to base class
             parent::action($action_name);
     }
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:22,代码来源:HomePage.class.php


示例7: login

 /**
  * Login Customer
  */
 function login()
 {
     if ($this->post['user']->getPassword() == $this->post['password']) {
         // Only customers are allowed to login to the order form
         if ($this->post['user']->getType() != "Client") {
             $this->setError(array("type" => "[ONLY_CUSTOMERS_CAN_LOGIN]"));
             return;
         }
         // Login success
         $_SESSION['client']['userdbo'] = $this->post['user'];
         log_notice("CustomerLoginPage::login()", "User: " . $this->post['user']->getUsername() . " logged in.");
         $this->gotoPage("cart");
     } else {
         // Login failure
         log_security("CustomerLoginPage::login()", "Password Incorrect.");
         $this->setError(array("type" => "[LOGIN_FAILED]"));
     }
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:21,代码来源:CustomerLoginPage.class.php


示例8: Engine_ErrorHandler

function Engine_ErrorHandler($errno, $errstr, $errfile, $errline)
{
    switch ($errno) {
        case E_ERROR:
            log_error($errstr, $errfile, $errline);
            break;
        case E_PARSE:
            log_error($errstr, $errfile, $errline);
            break;
        case E_WARNING:
            log_warning($errstr, $errfile, $errline);
            break;
        case E_NOTICE:
            log_notice($errstr, $errfile, $errline);
            break;
        default:
            log_notice($errstr, $errfile, $errline);
    }
}
开发者ID:romlg,项目名称:cms36,代码行数:19,代码来源:error.lib.php


示例9: login

 /**
  * Login
  *
  * Validate the login.  Store the UserDBO in the session if OK, or display an error
  * if the login failed.
  */
 function login()
 {
     try {
         $user_dbo = load_UserDBO($this->post['username']);
         if ($user_dbo->getPassword() == $this->post['password'] && ($user_dbo->getType() == "Administrator" || $user_dbo->getType() == "Account Manager")) {
             // Login success
             if (isset($this->post['theme'])) {
                 $user_dbo->setTheme($this->post['theme']);
             }
             $_SESSION['client']['userdbo'] = $user_dbo;
             log_notice("Login", "User: " . $user_dbo->getUsername() . " logged in");
             $_SESSION['jsFunction'] = "reloadMenu()";
             $this->gotoPage("home");
         }
     } catch (DBNoRowsFoundException $e) {
     }
     // Login failure
     log_security("Login", "Login failed for " . $this->post['username']);
     throw new SWUserException("[LOGIN_FAILED]");
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:26,代码来源:LoginPage.class.php


示例10: cache_memcache_connect

function cache_memcache_connect()
{
    if (!isset($GLOBALS['remote_cache_conns']['memcache'])) {
        $host = $GLOBALS['cfg']['memcache_host'];
        $port = $GLOBALS['cfg']['memcache_port'];
        $start = microtime_ms();
        $memcache = new Memcache();
        if (!$memcache->connect($host, $port)) {
            $memcache = null;
        }
        if (!$memcache) {
            log_fatal("Connection to memcache {$host}:{$port} failed");
        }
        $end = microtime_ms();
        $time = $end - $start;
        log_notice("cache", "connect to memcache {$host}:{$port} ({$time}ms)");
        $GLOBALS['remote_cache_conns']['memcache'] = $memcache;
        $GLOBALS['timings']['memcache_conns_count']++;
        $GLOBALS['timings']['memcache_conns_time'] += $time;
    }
    return $GLOBALS['remote_cache_conns']['memcache'];
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:22,代码来源:lib_cache_memcache.php


示例11: db_ping

function db_ping($cluster, $shard = null)
{
    $cluster_key = _db_cluster_key($cluster, $shard);
    if (is_resource($GLOBALS['db_conns'][$cluster_key])) {
        $start = microtime_ms();
        $ret = @mysql_ping($GLOBALS['db_conns'][$cluster_key]);
        $end = microtime_ms();
        log_notice('db', "DB-{$cluster_key}: Ping", $end - $start);
        return $ret;
    }
    return FALSE;
}
开发者ID:jacques,项目名称:flamework,代码行数:12,代码来源:lib_db.php


示例12: _hash

 function _hash($data, $controlType)
 {
     if (!$this->enabling) {
         return false;
     }
     switch ($controlType) {
         case 'md5':
             return md5($data);
         case 'crc32':
             return sprintf('% 32d', crc32($data));
         case 'strlen':
             return sprintf('% 32d', strlen($data));
         default:
             log_notice('Не определенн контроль записи "' . $controlType . '" кэша данных');
     }
 }
开发者ID:romlg,项目名称:cms36,代码行数:16,代码来源:data_cache.class.php


示例13: notice

 /**
  * Notice logging
  * 
  * @param string $message
  */
 public static function notice($message)
 {
     log_notice($message);
 }
开发者ID:jokopurnomoa,项目名称:elips-php,代码行数:9,代码来源:Log.php


示例14: shown

# * notice - Some action has happened that's useful for debugging
#
# By default, errors and fatals are always shown, but notices are only shown when
# `debug=1` is passed in the querystring or `$cfg['admin_flags_show_notices']` is
# set. Messages are only shown (on webpages) for callers with appropriate auth
# (see lib_auth.php for more details).
#
# The 'html' and 'plain' handlers are smart and will only show output where appropriate - the
# html version for web pages and the plain version for CLI scripts.
#
$GLOBALS['log_handlers'] = array('notice' => array('html', 'plain'), 'error' => array('html', 'plain', 'error_log'), 'fatal' => array('html', 'plain', 'error_log'));
$GLOBALS['log_html_colors'] = array('db' => '#eef,#000', 'cache' => '#fdd,#000', 'smarty' => '#efe,#000', 'http' => '#ffe,#000', '_error' => '#fcc,#000', '_fatal' => '#800,#fff');
#
# log a startup notice so we know what page this is and what env
#
log_notice('init', "this is {$_SERVER['SCRIPT_NAME']} on {$GLOBALS['cfg']['environment']}");
###################################################################################################################
#
# public api
#
function log_fatal($msg)
{
    _log_dispatch('fatal', $msg);
    error_500();
    exit;
}
function log_error($msg)
{
    _log_dispatch('error', $msg);
}
function log_notice($type, $msg, $time = -1)
开发者ID:whosonfirst,项目名称:flamework,代码行数:31,代码来源:lib_log.php


示例15: cache_memcache_unset

function cache_memcache_unset($key)
{
    $memcache = cache_memcache_connect();
    if (!$memcache) {
        log_error('Failed to connect to memcache for unset');
        return array('ok' => 0, 'local' => 1, 'remote' => 0, 'error' => 'memcache_cant_connect');
    }
    $ok = $memcache->delete($key);
    if (!$ok) {
        log_error("Failed to unset memcache key {$key}");
        return array('ok' => 0, 'local' => 1, 'remote' => 0, 'error' => 'memcache_unset_failed');
    }
    log_notice("cache", "remote unset {$key}");
    return array('ok' => 1, 'local' => 1, 'remote' => 1);
}
开发者ID:whosonfirst,项目名称:flamework,代码行数:15,代码来源:lib_cache_memcache.php


示例16: _db_query

	function _db_query($sql, $cluster, $k=null){

		$cluster_key = $k ? "{$cluster}-{$k}" : $cluster;

		if (!$GLOBALS['db_conns'][$cluster_key]){
			_db_connect($cluster, $k);
		}

		$trace = _db_callstack();
		$use_sql = _db_comment_query($sql, $trace);

		$start = microtime_ms();
		$result = @mysql_query($use_sql, $GLOBALS['db_conns'][$cluster_key]);
		$end = microtime_ms();

		$GLOBALS['timings']['db_queries_count']++;
		$GLOBALS['timings']['db_queries_time'] += $end-$start;

		log_notice('db', "DB-$cluster_key: $sql ($trace)", $end-$start);


		#
		# profiling?
		#

		$profile = null;

		if ($GLOBALS['cfg']['db_profiling']){
			$profile = array();
			$p_result = @mysql_query("SHOW PROFILE ALL", $GLOBALS['db_conns'][$cluster_key]);
			while ($p_row = mysql_fetch_array($p_result, MYSQL_ASSOC)){
				$profile[] = $p_row;
			}
		}


		#
		# build result
		#

		if (!$result){
			$error_msg	= mysql_error($GLOBALS['db_conns'][$cluster_key]);
			$error_code	= mysql_errno($GLOBALS['db_conns'][$cluster_key]);

			log_error("DB-$cluster_key: $error_code ".HtmlSpecialChars($error_msg));

			$ret = array(
				'ok'		=> 0,
				'error'		=> $error_msg,
				'error_code'	=> $error_code,
				'sql'		=> $sql,
				'cluster'	=> $cluster,
				'shard'		=> $k,
			);
		}else{
			$ret = array(
				'ok'		=> 1,
				'result'	=> $result,
				'sql'		=> $sql,
				'cluster'	=> $cluster,
				'shard'		=> $k,
			);
		}

		if ($profile) $ret['profile'] = $profile;

		return $ret;
	}
开发者ID:power7714,项目名称:glitch-mash,代码行数:68,代码来源:lib_db.php


示例17: setMessage

 /**
  * Set Message
  *
  * Set a message in the Page session
  *
  * @param array $message Message data
  */
 function setMessage($message)
 {
     $_SESSION['messages'][] = $message;
     // Insert arguments into message
     // TODO: This probably results in running translate twice - needed a quick fix
     $text = Translator::getTranslator()->translateString($message['type']);
     if (isset($message['args'])) {
         foreach ($message['args'] as $i => $arg) {
             $text = str_replace("{" . $i . "}", $arg, $text);
         }
     }
     log_notice($this->getClassName(), $text);
 }
开发者ID:carriercomm,项目名称:NeoBill,代码行数:20,代码来源:Page.class.php


示例18: IsCacheGPC

 /**
  * Выдавать ли кеш или нет из-за GPC
  */
 function IsCacheGPC()
 {
     //return true; // включался для тестирования
     // Если _GET или _POST - кеша не будет
     if ($_GET || $_POST) {
         return false;
     }
     // Если сессия - кеша не будет
     if (isset($_COOKIE[session_name()])) {
         if (DEV_MODE) {
             log_notice("cache rejected because of session");
         }
         return false;
     }
     // Если в куках есть нужные переменные - кеша не будет (CACHE_COOKIE)
     if ($_COOKIE && defined('CACHE_COOKIE')) {
         $vars = explode(',', CACHE_COOKIE);
         if (!$vars) {
             foreach ($vars as $var) {
                 if (isset($_COOKIE[trim($var)])) {
                     return false;
                 }
             }
         }
     }
     return true;
     // false - генерим страницу
     // true - берем из кеша
 }
开发者ID:romlg,项目名称:cms36,代码行数:32,代码来源:page_cache.class.php


示例19: http_get

	function http_get($url){

		$ch = curl_init();

		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); # Get around error 417
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_TIMEOUT, $GLOBALS['cfg']['http_timeout']);
		curl_setopt($ch, CURLINFO_HEADER_OUT, true);
		curl_setopt($ch, CURLOPT_HEADER, true);


		#
		# execute request
		#

		$start = microtime_ms();

		$raw = curl_exec($ch);
		$info = curl_getinfo($ch);

		$end = microtime_ms();

		curl_close($ch);

		$GLOBALS['timings']['http_count']++;
		$GLOBALS['timings']['http_time'] += $end-$start;


		#
		# parse request & response
		#

		list($head, $body) = explode("\r\n\r\n", $raw, 2);
		list($head_out, $body_out) = explode("\r\n\r\n", $info['request_header'], 2);
		unset($info['request_header']);

		$headers_in = http_parse_headers($head, '_status');
		$headers_out = http_parse_headers($head_out, '_request');
		log_notice("http", "GET $url", $end-$start);


		#
		# return
		#

	        if ($info['http_code'] != "200"){

			return array(
				'ok'		=> 0,
				'error'		=> 'http_failed',
				'code'		=> $info['http_code'],
				'url'		=> $url,
				'info'		=> $info,
				'req_headers'	=> $headers_out,
				'headers'	=> $headers_in,
				'body'		=> $body,
			);
		}

		return array(
			'ok'		=> 1,
			'url'		=> $url,
			'info'		=> $info,
			'req_headers'	=> $headers_out,
			'headers'	=> $headers_in,
			'body'		=> $body,
		);
	}
开发者ID:hfiguiere,项目名称:flamework,代码行数:70,代码来源:lib_http.php


示例20: simpleid_verify_signatures

/**
 * Verifies the signature of a signed OpenID request/response.
 *
 * @param array $request the OpenID request/response
 * @return bool true if the signature is verified
 * @since 0.8
 */
function simpleid_verify_signatures($request)
{
    global $version;
    log_info('simpleid_verify_signatures');
    $is_valid = TRUE;
    $assoc = isset($request['openid.assoc_handle']) ? cache_get('association', $request['openid.assoc_handle']) : NULL;
    $stateless = isset($request['openid.response_nonce']) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;
    if (!$assoc) {
        log_notice('simpleid_verify_signatures: Association not found.');
        $is_valid = FALSE;
    } elseif (!$assoc['assoc_type']) {
        log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');
        $is_valid = FALSE;
    } elseif (!isset($assoc['private']) || $assoc['private'] != 1) {
        log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');
        $is_valid = FALSE;
    } elseif (!$stateless || $stateless['assoc_handle'] != $request['openid.assoc_handle']) {
        log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');
        $is_valid = FALSE;
    } else {
        $mac_key = $assoc['mac_key'];
        $assoc_types = openid_association_types();
        $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];
        $signed_keys = explode(',', $request['openid.signed']);
        $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);
        log_debug('***** Signature: ' . $signature);
        if ($signature != $request['openid.sig']) {
            log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');
            $is_valid = FALSE;
        }
        cache_delete('stateless', $request['openid.response_nonce']);
    }
    return $is_valid;
}
开发者ID:richardneish,项目名称:richardneish.github.com,代码行数:41,代码来源:index.php



注:本文中的log_notice函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP log_register函数代码示例发布时间:2022-05-15
下一篇:
PHP log_msg函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap