Appearance
Production Logging Policy
Goals
- Keep
app.logfocused on operational signals - Route noisy protocol/stdio detail into dedicated debug files
- Preserve correlation fields for request and turn troubleshooting
- Never emit raw secrets or credentials
Default Log Files
data/logs/app.log- main operational log
data/logs/agent-stdio.log- stdio / ACP / protocol debug detail
Standard Field Names
Use these names whenever the context exists:
traceIdchatIduserIdthreadIdthreadNameturnIdbackendIdproviderNamemodelNamepolicyFieldbranchNameresolverNameworktreePathfilePath
Avoid alternate field names such as:
backendName→backendIdsourceName/provider→providerNamemodel→modelNamewhen it refers to the configured model identifierbranch→branchNamepath→worktreePathorfilePath
For merge-specific correlation schema, see:
docs/merge-log-schema.md
Recommended Default Levels
server,handler,action,orchestrator,output,feishu:infobackend-config,git,commit,merge:infostdio-rpc,acp-rpc:debugand routed to dedicated filecodex-factory:infoby default,debugduring runtime/protocol diagnosis
Suggested production env:
bash
LOG_LEVEL=info
LOG_MODULE_LEVELS=stdio-rpc=debug,acp-rpc=debug
LOG_DEBUG_MODULES=stdio-rpc,acp-rpcCorrelation Rules
- Reuse
traceIdas the main log/audit correlation key - When available, set audit
correlationIdequal totraceId - Audit
detailJson.correlationIdshould match the operational logtraceId
Secret Safety
Logger redaction must mask values for keys matching:
tokensecretpasswordauthorizationapiKeycookie
Never intentionally log:
- raw Feishu secrets
- raw provider API keys
- raw git clone tokens
- raw bearer tokens
Best-Effort Failure Rule
Best-effort async actions may stay non-blocking, but must emit:
warnfor degraded behaviorerrorfor user-visible failure or broken control flow