From c43325880bee5eb6c2716fa04a093746383edca7 Mon Sep 17 00:00:00 2001 From: dongwei <838456736@qq.com> Date: Wed, 20 Feb 2019 15:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=92=8C=E9=93=BE=E6=8E=A5=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Middleware/TunnelMiddleware.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Middleware/TunnelMiddleware.php b/src/Middleware/TunnelMiddleware.php index c13cd14..35fe435 100644 --- a/src/Middleware/TunnelMiddleware.php +++ b/src/Middleware/TunnelMiddleware.php @@ -39,10 +39,10 @@ class TunnelMiddleware { //过滤tool返回结果 if ($response instanceof JsonResponse) { - if (app()->environment('dev')) { + if (app()->environment('develop')) { $content = $response->getOriginalContent(); $status = isset($content['error']) ? $content['error']['code'] : 200; - $client = new \InfluxDB\Client("10.0.1.67"); + $client = new \InfluxDB\Client("10.0.1.67", 8086, '', '', false, false, 1, 1); $database = $client->selectDB('rpc_monitor'); $points = array( new Point( @@ -52,7 +52,8 @@ class TunnelMiddleware ['content' => $request->getContent(), 'status_value' => $status == 200 ? $status : -$status] ) ); - app('rpc.logger')->info('record to influxdb', ['rs' => $database->writePoints($points, Database::PRECISION_SECONDS)]); + app('rpc.logger')->info('record to influxdb', + ['rs' => $database->writePoints($points, Database::PRECISION_SECONDS)]); } }