对接日志默认仅记录告警与错误

新增 LOG_INTEGRATION_LEVEL(默认 warn),压低 integration-*.log 体积;
失败类文案自动提升为 error,避免异常被过滤。
This commit is contained in:
yml2213
2026-07-10 21:17:55 +08:00
parent 50d32be0ea
commit 01f46e4fc7
9 changed files with 43 additions and 2 deletions
+2
View File
@@ -14,6 +14,8 @@ export function createDefaultRuntimeConfig(projectRoot: string): RuntimeConfig {
logging: {
level: "info",
// 对接日志默认只保留 warn/error,避免 integration-*.log 被 info 刷爆
integrationLevel: "warn",
retentionDays: 30,
},
@@ -82,6 +82,7 @@ function createRuntimeConfig(): RuntimeConfig {
},
logging: {
level: 'info',
integrationLevel: 'warn',
retentionDays: 30,
},
database: {
+1
View File
@@ -33,6 +33,7 @@ export const ENV_OVERRIDES: readonly EnvOverride[] = [
integerEnv("PORT", ["server", "port"]),
stringEnv("DATA_ROOT", ["data", "root"], path.resolve),
stringEnv("LOG_LEVEL", ["logging", "level"]),
stringEnv("LOG_INTEGRATION_LEVEL", ["logging", "integrationLevel"]),
integerEnv("LOG_RETENTION_DAYS", ["logging", "retentionDays"]),
stringEnv("DATABASE_URL", ["database", "url"]),
booleanEnv("DATABASE_SSL", ["database", "ssl"]),
@@ -117,6 +117,7 @@ function createRuntimeConfig(overrides: Record<string, unknown> = {}): RuntimeCo
},
logging: {
level: 'info',
integrationLevel: 'warn',
},
database: {
url: 'postgres://postgres:postgres@postgres:5432/order_site',