From 4e2a2a66be3014f5d848cefc237388cc5c1b63c0 Mon Sep 17 00:00:00 2001 From: dongwei <838456736@qq.com> Date: Thu, 31 Jan 2019 15:38:57 +0800 Subject: [PATCH] add log --- src/Middleware/TunnelMiddleware.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Middleware/TunnelMiddleware.php b/src/Middleware/TunnelMiddleware.php index ff59f5c..2c0ffb8 100644 --- a/src/Middleware/TunnelMiddleware.php +++ b/src/Middleware/TunnelMiddleware.php @@ -40,6 +40,7 @@ class TunnelMiddleware //过滤tool返回结果 if ($response instanceof JsonResponse) { if (app()->environment('dev', 'production')) { + app('rpc.logger')->info('record to influxdb'); $content = $response->getOriginalContent(); $status = isset($content['error']) ? $content['error']['code'] : 200; $client = new \InfluxDB\Client("10.0.1.67"); @@ -52,7 +53,7 @@ class TunnelMiddleware ['content' => $request->getContent()] ) ); - $database->writePoints($points, Database::PRECISION_SECONDS); + app('rpc.logger')->info('record to influxdb', ['rs' => $database->writePoints($points, Database::PRECISION_SECONDS)]); } }