Authored by cailing

配置更改

@@ -22,19 +22,20 @@ class Yohobuy @@ -22,19 +22,20 @@ class Yohobuy
22 // const YOHOBUY_URL = 'http://www.yohobuy.com/'; 22 // const YOHOBUY_URL = 'http://www.yohobuy.com/';
23 23
24 //java API 24 //java API
25 - const API_URL = 'http://api.yoho.yohoops.org/';//  
26 - const API_URL2 = 'http://api.yoho.yohoops.org/';//  
27 - const SERVICE_URL = 'http://service.yoho.yohoops.org/';  
28 - const YOHOBUY_URL = 'http://www.yohobuy.com/';  
29 - const API_OLD = 'http://api2.open.yohobuy.com/';  
30 - const SERVICE_NOTIFY = 'http://service.yoho.cn/';// 支付回调地址  
31 -  
32 - // 测试环境  
33 -// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'  
34 -// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';  
35 -// const YOHOBUY_URL = 'http://www.yohobuy.com/';  
36 -// const API_OLD = 'http://test2.open.yohobuy.com/';  
37 -// // 支付回调地址 25 + const API_URL = 'http://api.yoho.yohoops.org/';//
  26 + const API_URL2 = 'http://api.yoho.yohoops.org/';//
  27 + const SERVICE_URL = 'http://service.yoho.yohoops.org/';
  28 + const YOHOBUY_URL = 'http://www.yohobuy.com/';
  29 + const API_OLD = 'http://api2.open.yohobuy.com/';
  30 +//// 支付回调地址
  31 + const SERVICE_NOTIFY = 'http://service.yoho.cn/';
  32 +
  33 + // 测试环境 */
  34 +// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
  35 +// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
  36 +// const YOHOBUY_URL = 'http://www.yohobuy.com/';
  37 +// const API_OLD = 'http://test2.open.yohobuy.com/';
  38 +//// 支付回调地址
38 // const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/'; 39 // const SERVICE_NOTIFY = 'http://testservice.yoho.cn:28077/';
39 40
40 /* 预览环境 */ 41 /* 预览环境 */
@@ -17,6 +17,8 @@ namespace WebPlugin; @@ -17,6 +17,8 @@ namespace WebPlugin;
17 */ 17 */
18 class UdpLog 18 class UdpLog
19 { 19 {
  20 + //日志开关
  21 + private static $flag = true;
20 //influxdb url 22 //influxdb url
21 public static $url = 'influxdb.yohobuy.com'; 23 public static $url = 'influxdb.yohobuy.com';
22 //influxdb port 24 //influxdb port
@@ -32,6 +34,15 @@ class UdpLog @@ -32,6 +34,15 @@ class UdpLog
32 const RECORD_MODE = 'FILE';//mode: FILE | UDP 34 const RECORD_MODE = 'FILE';//mode: FILE | UDP
33 35
34 /** 36 /**
  37 + * 初始化
  38 + */
  39 + private function __construct()
  40 + {
  41 + if (self::$flag) {
  42 + return;
  43 + }
  44 + }
  45 + /**
35 * proc line and send log to influxdb 46 * proc line and send log to influxdb
36 * @param $level 47 * @param $level
37 * @param $message 48 * @param $message
@@ -158,4 +169,13 @@ class UdpLog @@ -158,4 +169,13 @@ class UdpLog
158 public static function debug($message, $meta = '') { 169 public static function debug($message, $meta = '') {
159 self::procLog(__METHOD__, $message, debug_backtrace(), $meta); 170 self::procLog(__METHOD__, $message, debug_backtrace(), $meta);
160 } 171 }
  172 +
  173 + /**
  174 + * yaf trigger error
  175 + * @param $message
  176 + * @param mixed $meta
  177 + */
  178 + public static function triggerError($message, $meta = '') {
  179 + self::procLog(__METHOD__, $message, debug_backtrace(), $meta);
  180 + }
161 } 181 }