Skip to content

Commit 55e4f38

Browse files
committed
feat: add DISABLE_TRACING env which useful save logs
1 parent ab78309 commit 55e4f38

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

server/moleculer.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ if (config.feature.disableInfoLog === true) {
1616
brokerConfig.logLevel = 'error';
1717
}
1818

19+
if (config.feature.disableTracing === true) {
20+
brokerConfig.tracing = undefined;
21+
}
22+
1923
export default brokerConfig;

server/packages/sdk/src/services/lib/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const config = {
6767
disableFileCheck: checkEnvTrusty(process.env.DISABLE_FILE_CHECK),
6868
disableLogger: checkEnvTrusty(process.env.DISABLE_LOGGER), // 是否关闭日志
6969
disableInfoLog: checkEnvTrusty(process.env.DISABLE_INFO_LOG), // 是否关闭常规日志(仅保留错误日志)
70+
disableTracing: checkEnvTrusty(process.env.DISABLE_TRACING), // 是否关闭链路追踪
7071
disableUserRegister: checkEnvTrusty(process.env.DISABLE_USER_REGISTER), // 是否关闭用户注册功能
7172
disableGuestLogin: checkEnvTrusty(process.env.DISABLE_GUEST_LOGIN), // 是否关闭用户游客登录功能
7273
disableCreateGroup: checkEnvTrusty(process.env.DISABLE_CREATE_GROUP), // 是否禁用用户创建群组功能

website/docs/deployment/environment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ title: Environment Variable
2929
| TIANJI_WEBSITE_ID | - | Tianji website id |
3030
| 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 |
3131
| DISABLE_LOGGER | - | Whether to disable the log output, if "1" or "true" turn off the log on the fly |
32+
| 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 |
3233
| DISABLE_USER_REGISTER | - | Whether to disable the user register, if "1" or "true" turn off this method |
3334
| DISABLE_GUEST_LOGIN | - | Whether to disable the guest login, if "1" or "true" turn off this method |
3435
| DISABLE_CREATE_GROUP | - | Whether to disable user create group, if "1" or "true" turn off this method |

website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ title: 环境变量
2929
| TIANJI_WEBSITE_ID | - | Tianji 网站 id |
3030
| DISABLE_MESSAGEPACK | - | 是否禁用 openapi 的 sockio 使用 messagepack 作为 [解析器](https://socket.io/zh-CN/docs/v4/custom-parser/), 如果为 "1" 或者 "true" 则禁用该功能 |
3131
| DISABLE_LOGGER | - | 是否禁用日志输出, 如果为 "1" 或者 "true" 则在运行中关闭日志 |
32+
| DISABLE_TRACING | - | 是否禁用Tracing功能(开启可以节约大量日志), 如果为 "1" 或者 "true" 则在运行中关闭日志 |
3233
| DISABLE_USER_REGISTER | - | 是否关闭用户注册功能, 如果为 "1" 或者 "true" 则关闭该功能 |
3334
| DISABLE_GUEST_LOGIN | - | 是否关闭用户游客登录功能, 如果为 "1" 或者 "true" 则关闭该功能 |
3435
| DISABLE_CREATE_GROUP | - | 是否关闭用户创建群组功能, 如果为 "1" 或者 "true" 则关闭该功能 |

0 commit comments

Comments
 (0)