Skip to content

Commit

Permalink
feat: add DISABLE_TRACING env which useful save logs
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Oct 5, 2024
1 parent ab78309 commit 55e4f38
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/moleculer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ if (config.feature.disableInfoLog === true) {
brokerConfig.logLevel = 'error';
}

if (config.feature.disableTracing === true) {
brokerConfig.tracing = undefined;
}

export default brokerConfig;
1 change: 1 addition & 0 deletions server/packages/sdk/src/services/lib/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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), // 是否禁用用户创建群组功能
Expand Down
1 change: 1 addition & 0 deletions website/docs/deployment/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" 则关闭该功能 |
Expand Down

0 comments on commit 55e4f38

Please sign in to comment.