diff --git a/server/moleculer.config.ts b/server/moleculer.config.ts index a04766e1..f41ccc42 100644 --- a/server/moleculer.config.ts +++ b/server/moleculer.config.ts @@ -16,4 +16,8 @@ if (config.feature.disableInfoLog === true) { brokerConfig.logLevel = 'error'; } +if (config.feature.disableTracing === true) { + brokerConfig.tracing = undefined; +} + export default brokerConfig; diff --git a/server/packages/sdk/src/services/lib/settings.ts b/server/packages/sdk/src/services/lib/settings.ts index 889f2ed7..e31baf3c 100644 --- a/server/packages/sdk/src/services/lib/settings.ts +++ b/server/packages/sdk/src/services/lib/settings.ts @@ -67,6 +67,7 @@ export const config = { disableFileCheck: checkEnvTrusty(process.env.DISABLE_FILE_CHECK), disableLogger: checkEnvTrusty(process.env.DISABLE_LOGGER), // 是否关闭日志 disableInfoLog: checkEnvTrusty(process.env.DISABLE_INFO_LOG), // 是否关闭常规日志(仅保留错误日志) + disableTracing: checkEnvTrusty(process.env.DISABLE_TRACING), // 是否关闭链路追踪 disableUserRegister: checkEnvTrusty(process.env.DISABLE_USER_REGISTER), // 是否关闭用户注册功能 disableGuestLogin: checkEnvTrusty(process.env.DISABLE_GUEST_LOGIN), // 是否关闭用户游客登录功能 disableCreateGroup: checkEnvTrusty(process.env.DISABLE_CREATE_GROUP), // 是否禁用用户创建群组功能 diff --git a/website/docs/deployment/environment.md b/website/docs/deployment/environment.md index e57629fc..a496c43c 100644 --- a/website/docs/deployment/environment.md +++ b/website/docs/deployment/environment.md @@ -29,6 +29,7 @@ title: Environment Variable | TIANJI_WEBSITE_ID | - | Tianji website id | | DISABLE_MESSAGEPACK | - | Whether to disable using messagepack as [parser](https://socket.io/docs/v4/custom-parser/) for socketio in openapi, if "1" or "true" turn off this method | | DISABLE_LOGGER | - | Whether to disable the log output, if "1" or "true" turn off the log on the fly | +| DISABLE_TRACING | - | Whether to disable the Tracing function (enabling it can save a lot of logs), if "1" or "true" turn off the log on the fly | | DISABLE_USER_REGISTER | - | Whether to disable the user register, if "1" or "true" turn off this method | | DISABLE_GUEST_LOGIN | - | Whether to disable the guest login, if "1" or "true" turn off this method | | DISABLE_CREATE_GROUP | - | Whether to disable user create group, if "1" or "true" turn off this method | diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md index f11eb180..fe8b815e 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md @@ -29,6 +29,7 @@ title: 环境变量 | TIANJI_WEBSITE_ID | - | Tianji 网站 id | | DISABLE_MESSAGEPACK | - | 是否禁用 openapi 的 sockio 使用 messagepack 作为 [解析器](https://socket.io/zh-CN/docs/v4/custom-parser/), 如果为 "1" 或者 "true" 则禁用该功能 | | DISABLE_LOGGER | - | 是否禁用日志输出, 如果为 "1" 或者 "true" 则在运行中关闭日志 | +| DISABLE_TRACING | - | 是否禁用Tracing功能(开启可以节约大量日志), 如果为 "1" 或者 "true" 则在运行中关闭日志 | | DISABLE_USER_REGISTER | - | 是否关闭用户注册功能, 如果为 "1" 或者 "true" 则关闭该功能 | | DISABLE_GUEST_LOGIN | - | 是否关闭用户游客登录功能, 如果为 "1" 或者 "true" 则关闭该功能 | | DISABLE_CREATE_GROUP | - | 是否关闭用户创建群组功能, 如果为 "1" 或者 "true" 则关闭该功能 |