Skip to content

remove logger#6622

Merged
c121914yu merged 1 commit intolabring:mainfrom
c121914yu:fix-deploy
Mar 24, 2026
Merged

remove logger#6622
c121914yu merged 1 commit intolabring:mainfrom
c121914yu:fix-deploy

Conversation

@c121914yu
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 24, 2026 02:42
@c121914yu c121914yu merged commit 76c2d30 into labring:main Mar 24, 2026
5 of 6 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes sandbox logger-related environment configuration/validation and stops injecting the shared log env block into the code-sandbox service in the production docker-compose template.

Changes:

  • Removed logger environment keys from the sandbox envSchema.
  • Removed *x-log-config inheritance from the code-sandbox service in docker-compose.prod.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
projects/sandbox/src/env.ts Drops logger env vars from sandbox env validation.
deploy/templates/docker-compose.prod.yml Stops passing shared log env config into the code-sandbox container.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

restart: always
environment:
<<: [*x-log-config]
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-sandbox no longer inherits *x-log-config, but the sandbox app still configures @fastgpt-sdk/logger from env. With the log config removed, the SDK defaults to console logging enabled at trace level, which can significantly increase log volume in prod. Either keep *x-log-config for this service, or explicitly set LOG_ENABLE_CONSOLE/LOG_CONSOLE_LEVEL (or remove logger initialization + related env vars if the intent is to remove logging entirely).

Suggested change
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
LOG_OTEL_SERVICE_NAME: fastgpt-code-sandbox
LOG_ENABLE_CONSOLE: 'false'
LOG_CONSOLE_LEVEL: info

Copilot uses AI. Check for mistakes.
Comment on lines 29 to 32

// Logger
LOG_ENABLE_CONSOLE: z.boolean().default(true),
LOG_CONSOLE_LEVEL: LogLevelSchema.default('debug'),
LOG_ENABLE_OTEL: z.boolean().default(false),
LOG_OTEL_LEVEL: LogLevelSchema.default('info'),
LOG_OTEL_SERVICE_NAME: z.string().default('fastgpt-code-sandbox'),
LOG_OTEL_URL: z.url().optional(),

// ===== 进程池 =====
/** 进程池大小(预热 worker 数量) */
SANDBOX_POOL_SIZE: int(20).pipe(z.number().min(1).max(100)),
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger env block was removed from envSchema, but LogLevelSchema is still declared above and is now unused. Please remove LogLevelSchema (and any other now-unused logger-related declarations/imports) to avoid dead code and potential unused-symbol lint/TS errors.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Build Successful - Preview sandbox Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:sandbox_a89fc8216e3becbab55708fa2cbfc8a850e99e14

@github-actions
Copy link

Build Successful - Preview fastgpt Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fastgpt_a89fc8216e3becbab55708fa2cbfc8a850e99e14

@github-actions
Copy link

Build Successful - Preview mcp_server Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:mcp_server_a89fc8216e3becbab55708fa2cbfc8a850e99e14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants