From f76c23052c86afcf158087f8b13a7e47ef76f67c Mon Sep 17 00:00:00 2001 From: FX Date: Mon, 4 Feb 2019 18:20:51 +0800 Subject: [PATCH] docs(logger): add logger.outputJSON to docs (#3425) add logger.outputJSON to docs in both Chinese and English --- docs/source/en/core/logger.md | 9 +++++++++ docs/source/zh-cn/core/logger.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/source/en/core/logger.md b/docs/source/en/core/logger.md index c60fe4faf3..be45b041f9 100644 --- a/docs/source/en/core/logger.md +++ b/docs/source/en/core/logger.md @@ -128,6 +128,15 @@ exports.logger = { }; ``` +## Format +Use JSON as the output log format, make it easier to parse. +```js +// config/config.${env}.js +exports.logger = { + outputJSON: true, +}; +``` + ## Log Level Logs are designed in 5 levels, including `NONE`, `DEBUG`, `INFO`, `WARN` and `ERROR`. For inspecting in development, they will also be written into files and printed into terminal as well. diff --git a/docs/source/zh-cn/core/logger.md b/docs/source/zh-cn/core/logger.md index d5920cdc12..0c79adac01 100644 --- a/docs/source/zh-cn/core/logger.md +++ b/docs/source/zh-cn/core/logger.md @@ -133,6 +133,15 @@ exports.logger = { }; ``` +## 日志文件格式 +设置输出格式为JSON,方便日志监控系统分析 +```js +// config/config.${env}.js +exports.logger = { + outputJSON: true, +}; +``` + ## 日志级别 日志分为 `NONE`,`DEBUG`,`INFO`,`WARN` 和 `ERROR` 5 个级别。