From bab3596bde386c9fdbc15b473943033956f6a876 Mon Sep 17 00:00:00 2001 From: forecho Date: Sat, 21 Mar 2020 19:19:16 +0800 Subject: [PATCH] docs: update readme --- README.md | 2 +- src/Log.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f25fdb8..1ae5fd3 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Yii::info([ // short_message will contain 'Test short message', // two additional fields will be sent, -// full_message will contain all other stuff without 'short' and 'add': +// full_message will contain all other stuff without 'short' and 'additional': // string representation of ['test1' => 123, 'test2' => 456] Yii::info([ 'test1' => 123, diff --git a/src/Log.php b/src/Log.php index 1ba563e..2ca2500 100644 --- a/src/Log.php +++ b/src/Log.php @@ -26,12 +26,12 @@ public static function writeLog(string $name, array $message) $argOffset = 0; // $message['trace_id'] = request()->requestId; todo - $message['short'] = ArrayHelper::remove($message, (string)(0 + $argOffset)); $message['full'] = ArrayHelper::remove($message, (string)(1 + $argOffset)); $message['additional'] = ArrayHelper::remove($message, (string)(2 + $argOffset)); - $category = ArrayHelper::remove($message, (string)(3 + $argOffset), 'graylog'); + $category = ArrayHelper::remove($message, (string)(3 + $argOffset), 'graylog'); + $level = self::mapYiiLevel($name); \Yii::getLogger()->log($message, $level, $category);