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 个级别。